public bool Delete(int id)
 {
     try
     {
         _dbContext.Entry(new Product {
             Id = id
         }).State = EntityState.Deleted;
         _dbContext.SaveChanges();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
 public bool Delete(int id)
 {
     try
     {
         _businessLogicDbContext.Entry(new User {
             Id = id
         }).State = EntityState.Deleted;
         _businessLogicDbContext.SaveChanges();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }