Created
May 22, 2013 18:30
-
-
Save hmemcpy/5629791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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