public int AddTest(tblTest obj) { //obj.ID = 18; db.tblTests.Add(obj); db.SaveChanges(); return(obj.ID); }
public void UpdateTest(tblTest obj) { db.tblTests.Attach(obj); var update = db.Entry(obj); update.Property(x => x.Description).IsModified = true; update.Property(x => x.TestCategoryID).IsModified = true; update.Property(x => x.TestName).IsModified = true; db.SaveChanges(); }