Encapsulate it in your own class (or structure, if more appropriate).
public class UID { public int Value { get; set; } }
Write your methods in terms of your UID class, limiting the impact of the actual value type to the smallest subset of code needed.
publc class Entity { public UID ID { get; set; } public void Foo( UID otherID ) { if (otherID.Value == this.ID.Value) { ... } } } }
source share