public ATemplate Insert(ATemplate saveMe) // Insert a record { caciDbContent.ATemplate.Add(saveMe); if (caciDbContent.SaveChanges() <= 0) { throw new DbUpdateException("Unknown error"); } return(saveMe); }
public ATemplate Update(ATemplate saveMe) // Update record { var dao = caciDbContent.ATemplate.First(e => e.Id == saveMe.Id); dao.Id = saveMe.Id; caciDbContent.ATemplate.Update(dao); if (caciDbContent.SaveChanges() <= 0) { throw new DbUpdateException("Unknown error"); } return(saveMe); }