Skip to content

Instantly share code, notes, and snippets.

@mat-mcloughlin
Created August 25, 2014 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mat-mcloughlin/fce0b97ab0f36c4fc48f to your computer and use it in GitHub Desktop.
Save mat-mcloughlin/fce0b97ab0f36c4fc48f to your computer and use it in GitHub Desktop.
Typed Guid
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