Mysql and Subsonic 3 with LINQ: Cannot insert rows

Posted by Gustavo on Stack Overflow See other posts from Stack Overflow or by Gustavo
Published on 2010-04-25T15:24:28Z Indexed on 2010/04/25 15:33 UTC
Read the original article Hit count: 420

Filed under:
|
|

I'm using Susbsonic 3 with the LINQ templates. I've already added a column called 'ID' to my Articles table. When I try to insert a row using the following code

   var db = new LDB();
   int newID = db.Insert.Into<ArticlesTable>
                            (
                            x => x.Description
                            ).Values(
                            "TestDescription"
                            ).Execute();

I get the following error message

Can't decide which property to consider the Key - you can create one called 'ID' or mark one with SubSonicPrimaryKey attribute

Any clue on what I'm doing wrong?

© Stack Overflow or respective owner

Related posts about subsonic

Related posts about LINQ