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