Skip to content

Instantly share code, notes, and snippets.

@Nasicus
Nasicus / NullConditionalOperator.md
Last active September 7, 2015 07:00
Null conditional operator: Check value for true (boolean check)

I just want to know what you guys think of the following code part and if you think it's readable or if you'd do it differentely.

Let's assume we have this class:

public class Foo
{
  public bool IsFooBar { get; set; }
}

An now we want to check for IsFooBar, but are not sure if our instance of Foo is null: