I am new to Dapper, trying to write some code to test Dapper.Contrib.
[Dapper.Contrib.Extensions.Table("Cat")]
public class Cat
{
[Dapper.Contrib.Extensions.Key]
public string catid {get;set;}
public string catName {get;set;}
}
...
Cat cat = new Cat(){catid="somecharmaybe", catName="testcat"}
conn.Insert(cat);
When I run the application, following exception is thrown
can not insert null value to primary key catid
Can anyone give me some advice?