예제 #1
0
        public IResult <IEnumerable <T> > FindAllWithFilter <TFilter>(
            TFilter filter,
            int skip = AppConstants.DEFAULT_SKIP,
            int take = AppConstants.DEFAULT_TAKE
            ) where TFilter : IFilterParameters => Do <IEnumerable <T> > .Try(r =>
        {
            var filterExpression = _filterConductor.ComposeFilterExpressionFromParameters(filter);
            var result           = _readRepository.FindAllByFilter(filterExpression, skip, take);

            if (result.HasErrorsOrResultIsNull())
            {
                r.AddErrors(result);
                return(default(IEnumerable <T>));
            }

            return(result.ResultObject);
        })
        .Result;