Esempio n. 1
0
        protected override IncludeSettings <Recipe> GetIncludeSettings()
        {
            IncludeSettings <Recipe> builder = base.GetIncludeSettings();

            builder.ApplySettings(recipe => recipe.CreatedBy);

            return(builder);
        }
Esempio n. 2
0
        private IQueryable <TEntity> ApplyIncludeSettings(
            IQueryable <TEntity> queryable,
            IncludeSettings <TEntity> settings)
        {
            if (settings == null || settings.IncludeExpressionsExpressions.IsNullOrEmpty())
            {
                return(queryable);
            }

            // TODO: will be added on demand
            return(queryable);
        }
Esempio n. 3
0
        private IQueryable <TEntity> ApplyIncludeSettings(
            IQueryable <TEntity> queryable,
            IncludeSettings <TEntity> settings)
        {
            if (settings == null || settings.IncludeExpressionsExpressions.IsNullOrEmpty())
            {
                return(queryable);
            }

            foreach (var expression in settings.IncludeExpressionsExpressions)
            {
                queryable = queryable.Include(expression);
            }
            return(queryable);
        }
 public QueryBuilder()
 {
     FilterSettings  = new FilterSettings <TEntity>();
     SortSettings    = new SortSettings <TEntity>();
     IncludeSettings = new IncludeSettings <TEntity>();
 }