Created
August 25, 2014 10:59
-
-
Save mat-mcloughlin/fce0b97ab0f36c4fc48f to your computer and use it in GitHub Desktop.
Typed Guid
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 class GameId : TypedGuid | |
{ | |
} | |
public class TypedGuid | |
{ | |
protected Guid Value { get; set; } | |
public static implicit operator Guid(TypedGuid typedGuid) | |
{ | |
return typedGuid.Value; | |
} | |
public static implicit operator TypedGuid(Guid guid) | |
{ | |
return new TypedGuid { Value = guid }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment