DbUpdateConcurrencyException on changing entity state and savingchanges RRS feed

  • Question

  • Whenever I add an entity to my dbContext and do a savechanges(), I get a DbUpdateConcurrencyException saying that store update insert delete has affected unexpected no of rows....Please let me know what is the problem, because I am excited about the EF 4.1 codefirst and want to use it in our next release.The code is :

    DealDataContext dealDataContext;
    dealDataContext = new DealDataContext();
     var deal = new Deal { DealID = 2 };

    Saturday, August 27, 2011 4:22 PM


All replies