Updating an entity with linq to sql, do I call attach first?

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-04-08T21:30:18Z Indexed on 2010/04/08 21:33 UTC
Read the original article Hit count: 193

Filed under:
|

My code looks like:

Entity e = new Entity();

e.name = "..."; e.blah = 234;

MyDb.UpdateEntity(e);

public static void UpdateEntity(Entity e)
{
    using(MyDatacontext dc = new MyDataContext())
    {

          dc. ?????????
    }

}

So what do I do here to update the entity?

note: i just called it entity here, its something else in my project.

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-sql