Skip to content

Instantly share code, notes, and snippets.

@lsmithmier
Created November 16, 2018 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsmithmier/fadf4070bdc5b1c5b513477c40fb314d to your computer and use it in GitHub Desktop.
Save lsmithmier/fadf4070bdc5b1c5b513477c40fb314d to your computer and use it in GitHub Desktop.
NullCheck
using System;
namespace SyntaxTester
{
class Program
{
static void Main(string[] args)
{
NullCheck nullCheck = null;
Console.WriteLine(string.Format("=>{0}", nullCheck==null?"":nullCheck.Message));
nullCheck = new NullCheck { Message = "Test2" };
Console.WriteLine(string.Format("=>{0}", nullCheck == null ? "" : nullCheck.Message));
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment