Пример #1
0
        public AutoDynamicQueryCore(IQueryable <T> query)
        {
            this.Query = query;

            metas = DynamicQueryCore.QueryMetadata(Query);

            StaticColumns = MemberEntryFactory.GenerateList <T>(MemberOptions.Properties | MemberOptions.Fields)
                            .Select((e, i) => new ColumnDescriptionFactory(i, e.MemberInfo, metas[e.MemberInfo.Name])).ToArray();
        }
Пример #2
0
 public static FluentInclude <T> WithQuery <T, Q>(this FluentInclude <T> fi, DynamicQueryManager dqm, Expression <Func <T, Q> > simpleQuerySelector, Action <AutoDynamicQueryCore <Q> > modifyQuery)
     where T : Entity
 {
     dqm.RegisterQuery <Q>(typeof(T), () =>
     {
         var autoQuery = DynamicQueryCore.Auto(Database.Query <T>().Select(simpleQuerySelector));
         modifyQuery(autoQuery);
         return(autoQuery);
     });
     return(fi);
 }
Пример #3
0
 public void Register <T>(object queryName, Func <IQueryable <T> > lazyQuery, Implementations?entityImplementations = null)
 {
     queries[queryName] = new DynamicQueryBucket(queryName, () => DynamicQueryCore.Auto(lazyQuery()), entityImplementations ?? DefaultImplementations(typeof(T), queryName));
 }
Пример #4
0
 public static FluentInclude <T> WithQuery <T>(this FluentInclude <T> fi, Func <Expression <Func <T, object> > > lazyQuerySelector)
     where T : Entity
 {
     QueryLogic.Queries.Register(typeof(T), new DynamicQueryBucket(typeof(T), () => DynamicQueryCore.FromSelectorUntyped(lazyQuerySelector()), Implementations.By(typeof(T))));
     return(fi);
 }