My class is like below:
[Table("tblUser")]
public class User
{
[Key]
public int Id { get; set; }
public string Title { get; set; }
}
Using Dapper.Contrib, is there a way to get the User
record by Title
instead of Id?
If I query like below, it works. But, I want to filter on Title
column which is not a key.
await connection.GetAsync<User>(Id);