public void Update(Category category) { using (var contest = new lugapasalcontext()) { contest.Entry(category).State = System.Data.Entity.EntityState.Modified; contest.SaveChanges(); } }
public void SaveCategory(Category category) { using (var contest = new lugapasalcontext()) { contest.categories.Add(category); contest.SaveChanges(); } }
public void Delete(int id) { using (var contest = new lugapasalcontext()) { var category = contest.categories.Find(id); contest.categories.Remove(category); contest.SaveChanges(); } }