public void Delete(T entity)
 {
     using (var context = new ToDoListDbContext())
     {
         var deleteEntity = context.Entry(entity);
         deleteEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
 public void Update(T entity)
 {
     using (var context = new ToDoListDbContext())
     {
         var updateEntity = context.Entry(entity);
         updateEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void Add(T entity)
 {
     using (var context = new ToDoListDbContext())
     {
         var addEntity = context.Entry(entity);
         addEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }