GraphDiff causing id of entity to not get populated after saveChanges()

entity-framework graphdiff

Popular Answer

So I discovered the answer: https://github.com/refactorthis/GraphDiff/issues/32#issuecomment-34420859

You must set the return to your entity since "GraphDiff delivers you a new instance back," which is important.

    public int CreateUpdate(Qualification qualification)
    {
        using (var db = new DataContext())
        {
            qualification = db.UpdateGraph(qualification);
            db.SaveChanges(qualification.AuditUserId);

            return qualification.Id;
        }
    }
3
7/16/2015 10:39:48 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow