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
public static void SwitchPattern(object o) | |
{ | |
switch (o) | |
{ | |
case null: | |
Console.WriteLine("it's a constant pattern"); | |
break; | |
case int i: | |
Console.WriteLine("it's an int"); | |
break; |
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
/// <summary> | |
/// Gets or the current customer if they are registered, if not registered it returns null | |
/// </summary> | |
[CanBeNull] | |
public virtual Customer CurrentRegisteredCustomer | |
{ | |
get | |
{ | |
//whether there is a cached value | |
if (_cachedCustomer != null) |