Skip to content

Instantly share code, notes, and snippets.

@JesseBuesking
Created August 8, 2013 21:59
Show Gist options
  • Save JesseBuesking/6189186 to your computer and use it in GitHub Desktop.
Save JesseBuesking/6189186 to your computer and use it in GitHub Desktop.
public struct Id
{
private long _id;
public Id(long id)
{
this._id = id;
}
public static implicit operator Id(long value)
{
return new Id(value);
}
public static implicit operator long(Id id)
{
return id._id;
}
}
void Main()
{
Id myId = 10L;
long value = myId;
value.Dump();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment