I\'m using Dapper to hammer out some load testing tools that need to access a PostgreSQL database. This particular version of PostgreSQL does not support GUIDs natively, so
This is an old question but I feel it needs updating as Dapper now supports private properties, which Marc referenced to in his answer.
private String UserIDString { get; set; }
public Guid UserID
{
get
{
return new Guid(UserIDString);
}
private set
{
UserID = value;
}
}
Then in SQL give your ID column an alias to map it to the private property and not the actual property:
SELECT UserID AS UserIDString FROM....