Open ghost opened 12 years ago
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);
}
}
@seburgi Do you want to create a separate issue for that? It's a good feature request, but not really the same as SQL Server UDTs.
@markrendle You are right, I created a new issue #310
User Defined Type support for SQL Server would be a great addition to Simple.Data. It would make Simple.Data much easier for those people who work with the Spatial components in SQL Server. Currently the way to pass SqlGeometry and SqlGeography types to SQL Server are to first convert to WKT or WKB. See the post below on StackOverflow for discussion of workaround.
http://stackoverflow.com/questions/13035158/passing-sqlgeometry-to-simple-data-stored-procedure