I am delighted :
// Insert a record with peta poco
var a = new Article();
a.title="My new article";
a.content="PetaPoco was here";
a.date_created=DateTime.UtcNow;
db.Insert(a);
I am distracted as follows:
// Insert entry with dapper
var a = new Article();
a.title="My new article";
a.content="PetaPoco was here";
a.date_created=DateTime.UtcNow;
string articleQuery= "INSERT INTO Article VALUES (@Title, @Content, @Date)";
connection.Execute(articleQuery, new { Title = a.Title, Content = a.Content, Date = a.Date });
I am new to dapper and peta poco. Maybe in what I haven't found yet, but I really don't like the way I should do the insertion. Peta Poco seems to be doing this very nicely.
Can it do this anyway?
source
share