Is there a way with dapper-dot-net to use an attribute to specify column names that should be used and not the property name?
public class Code
{
public int
Another approach is to just manually map it with the dynamic result.
var codes = conn.Query(...sql and params here...)
.Select(s=>new Code{Id = s.Id, Type = s.Type, Value = s.code, Description = s.Description});
Clearly this introduces type-safety scenarios because you are querying on dynamic. Also, you have to manually map columns which is a bummer.
However, I tend to like this approach because it's so darned transparent. You can cast if need be (as is the case with Enums), and basically just do whatever it is you need to do to go from the db recordset to your properties.