public int AddTestAttribute(tblTestAttribute obj) { //obj.ID = 18; db.tblTestAttributes.Add(obj); db.SaveChanges(); return(obj.ID); }
public void UpdateTestAttribute(tblTestAttribute obj) { db.tblTestAttributes.Attach(obj); var update = db.Entry(obj); update.Property(x => x.AttributeName).IsModified = true; update.Property(x => x.NormalRange).IsModified = true; update.Property(x => x.TestID).IsModified = true; db.SaveChanges(); }