Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
Created May 22, 2013 18:30
Show Gist options
  • Save hmemcpy/5629791 to your computer and use it in GitHub Desktop.
Save hmemcpy/5629791 to your computer and use it in GitHub Desktop.
class MyBusinessObject
{
public int? MyNullable;
public bool HasSomeBusinessProperty
{
get { return myNullable.HasValue; }
}
}
...
if (myBusinessObject.HasSomeBusinessProperty)
{
// do something with myBusinessObject.MyNullable.Value <-- ReSharper complains about possible InvalidOperationException
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment