Example #1
0
 public void DeleteTask(Task task)
 {
     var taskToDelete = GetTaskById(task.Id);
     if (taskToDelete != null)
     {
         base.EbalitDBContext.Tasks.Remove(taskToDelete);
         base.EbalitDBContext.SaveChanges();
     }
 }
Example #2
0
 public void UpdateTask(Task task)
 {
     var taskToUpdate = GetTaskById(task.Id);
     if (taskToUpdate != null)
     {
         base.EbalitDBContext.Entry(taskToUpdate).CurrentValues.SetValues(task);
         base.EbalitDBContext.SaveChanges();
     }
 }
Example #3
0
 public int CreateTask(Task task)
 {
     base.EbalitDBContext.Tasks.Add(task);
     base.EbalitDBContext.SaveChanges();
     return task.Id;
 }