Beispiel #1
0
        public static Task <IEnumerable <T> > QueryPageAsync <T>(this IRepository <T> repository, int pageIndex, int pageSize, Expression <Func <T, bool> > predicate, SortOptions options = null)
            where T : class
        {
            Guard.ArgumentNotNull(predicate, nameof(predicate));
            var filter = LamdaQueryParser.Where(predicate);

            return(repository.QueryPageAsync(pageIndex, pageSize, filter, options));
        }
Beispiel #2
0
        public static Task <T> QueryFirstOrDefaultAsync <T>(this IRepository <T> repository, Expression <Func <T, bool> > predicate)
            where T : class
        {
            Guard.ArgumentNotNull(predicate, nameof(predicate));
            var filter = LamdaQueryParser.Where(predicate);

            return(repository.QueryFirstOrDefaultAsync(filter));
        }
Beispiel #3
0
        public static int Delete <T>(this IRepository <T> repository, Expression <Func <T, bool> > predicate)
            where T : class
        {
            Guard.ArgumentNotNull(predicate, nameof(predicate));
            var filter = LamdaQueryParser.Where(predicate);

            return(repository.Delete(filter));
        }