public void Delete(TaskCategory taskCategory) { var originalRecord = base.EbalitDBContext.TaskCategories.Find(taskCategory.Id); if (originalRecord != null) { base.EbalitDBContext.TaskCategories.Remove(originalRecord); base.EbalitDBContext.SaveChanges(); } }
public void Update(TaskCategory taskCategory) { var originalRecord = base.EbalitDBContext.TaskCategories.Find(taskCategory.Id); if (originalRecord != null) { base.EbalitDBContext.Entry(originalRecord).CurrentValues.SetValues(taskCategory); base.EbalitDBContext.SaveChanges(); } }
public int Create(TaskCategory taskCategory) { base.EbalitDBContext.TaskCategories.Add(taskCategory); base.EbalitDBContext.SaveChanges(); return taskCategory.Id; }