public async Task <bool> RemoveAsync(long id) { TModel model = await GetByIdAsync(id); if (model == null) { return(false); } return(_context.Remove(model) != null); }
/// <inheritdoc /> public virtual async Task <bool> DeleteAsync(TModelType id) { TModel model = await GetByIdAsync(id); if (model == null) { //_logger.LogInformation($"delete: {id} does not exists"); throw new KeyNotFoundException(); } var result = _context.Remove(model) != null; //_logger.LogInformation($"removed: {id}"); return(result); }