public async Task DeleteProductAsync(T product)
 {
     using (var dbContext = new TheStoreContext())
     {
         dbContext.Remove(product);
         await dbContext.SaveChangesAsync();
     }
 }
Example #2
0
 public async Task DeleteUserAsync(User user)
 {
     using (var dbContext = new TheStoreContext())
     {
         dbContext.Remove(user);
         await dbContext.SaveChangesAsync();
     }
 }