Skip to content

Instantly share code, notes, and snippets.

@twofingerrightclick
Created September 8, 2021 23:27
Show Gist options
  • Save twofingerrightclick/a0eb029e6dbaf5f306aaafb2211d6dac to your computer and use it in GitHub Desktop.
Save twofingerrightclick/a0eb029e6dbaf5f306aaafb2211d6dac to your computer and use it in GitHub Desktop.
Listing 12.5: Declaring a Nullable Type That Contains a Value Property of Type object
struct Nullable
{
/// <summary>
/// Provides the value when HasValue returns true
/// </summary>
public object Value{ get; private set; }
/// <summary>
/// Indicates whether there is a value or whether
/// the value is "null"
/// </summary>
public bool HasValue{ get; private set; }
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment