public async Task DeleteAsync(TKey entityId) { TEntity entity = QueryableEntity.FirstOrDefault(p => p.Id.ToString().Equals(entityId.ToString())); await DeleteAsync(entity); await SaveChangesAsync(); }
public virtual Task <bool> ContainsAsync(TEntity entity) { return(Task.Run(() => QueryableEntity.FirstOrDefault(p => p.Id.Equals(entity.Id)) != null)); }
public virtual TEntity GetFirstOrDefault(Func <TEntity, bool> predicate) { return(QueryableEntity.FirstOrDefault(predicate)); }