public override void Update(EmployeeClassification classification) { using (var context = new OrmCookbook()) { context.Entry(classification).State = EntityState.Modified; context.SaveChanges(); } }
public void Update(Department department) { department.DivisionKey = department.Division.DivisionKey; using (var context = new OrmCookbook()) { context.Entry(department).State = EntityState.Modified; context.SaveChanges(); } }
public int Create(Department department) { using (var context = new OrmCookbook()) { context.Departments.Add(department); context.Entry(department.Division).State = EntityState.Unchanged; context.SaveChanges(); return(department.DepartmentKey); } }