Exemple #1
0
        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());
        }
Exemple #2
0
        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());
        }
Exemple #3
0
 public bool Any(IEntityFilter <TEntity> filter = null)
 {
     return((filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities).Any());
 }
Exemple #4
0
 public virtual int Count(IEntityFilter <TEntity> filter = null)
 {
     return((filter ?? EntityFilter <TEntity> .AsQueryable()).Filter(Entities).Count());
 }