I'm using classes for Entity identifying fields in our new codebase, which has some advantages that I do not want to go into full detail on right now. I was wondering if anyone has any experience and/or pointers on how to get this integrated with the data layer that LLBLGen generates.
i.e.:
public class FooIdentity : EntityIdentity
{
protected int Id { get; set;}
public static implicit operator int(FooIdentity i) { return i.Id; }
public static implicit operator FooIdentity(int i) { return new FooIdentity(i); }
}
public class Foo
{
public FooIdentity FooId { get; set; }
public string Bar { get; set; }
}
This allows for simple type casting from ints to Id's, but gives strong typing benefits from there onwards. I hope this gives the gist of what I'm attempting.