Пример #1
0
 public bool Delete(int id)
 {
     try
     {
         _dbContext.Entry(new Location {
             id = id
         }).State = EntityState.Deleted;;
         _dbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
 public bool Delete(int id)
 {
     try
     {
         _studentDbContext.Entry(new Student {
             StudentId = id
         }).State = EntityState.Deleted;;
         _studentDbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }