-
-
Save mahizsas/5527618 to your computer and use it in GitHub Desktop.
This file contains hidden or 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<T> | |
| { | |
| public readonly int Value; | |
| public Id(int value) | |
| { | |
| this.value = value; | |
| } | |
| public static implicit operator Id<T>(int value) | |
| { | |
| return new Id<T>(value); | |
| } | |
| public override bool Equals(object obj) | |
| { | |
| return obj is Id<T> && ((Id<T>) obj).value == value; | |
| } | |
| public override int GetHashCode() | |
| { | |
| return value.GetHashCode(); | |
| } | |
| public override string ToString() | |
| { | |
| return value.ToString(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment