public async Task DeleteAsync(int id) { var user = _dataContext.Users.Find(id); if (user == null) { return; } _dataContext.Users.Remove(user); await _dataContext.SaveChangesAsync(); }
public async Task DeleteBookAsync(int bookId) { var book = _dataContext.Books.Find(bookId); if (book == null) { return; } _dataContext.Books.Remove(book); await _dataContext.SaveChangesAsync(); }