public TEntity First(IEntityFilter <TEntity> filter = null, IEntitySorter <TEntity> sorter = null, IEntityLoader <TEntity> loader = null) { var entities = (filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities); if (loader != null) { return(loader.First(entities)); } return(entities.First()); }
public TEntity SingleOrDefault(IEntityFilter <TEntity> filter = null, IEntityLoader <TEntity> loader = null) { var entities = (filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities); if (loader != null) { return(loader.SingleOrDefault(entities)); } return(entities.SingleOrDefault()); }
public bool Any(IEntityFilter <TEntity> filter = null) { return((filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities).Any()); }
public virtual int Count(IEntityFilter <TEntity> filter = null) { return((filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities).Count()); }