Created
August 8, 2013 21:59
-
-
Save JesseBuesking/6189186 to your computer and use it in GitHub Desktop.
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 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