In some of my projects I use strongly typed Ids to make my Dtos more explicit. Those Ids are mostly wrappers around a simple type (like long) with implicit conversion operators. Would be great if I could use those directly for data access with Simple.Data.
public class PersonId
{
public PersonId(long id)
{
Id = id;
}
public PersonId() {}
public long Id { get; protected set; }
public static implicit operator long(PersonId id)
{
return id.Id;
}
public static implicit operator PersonId(long id)
{
return new PersonId(id);
}
}
In some of my projects I use strongly typed Ids to make my Dtos more explicit. Those Ids are mostly wrappers around a simple type (like long) with implicit conversion operators. Would be great if I could use those directly for data access with Simple.Data.