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); }
public static FluentInclude <T> WithExpressionFrom <T, F>(this FluentInclude <T> fi, DynamicQueryManager dqm, Expression <Func <F, IQueryable <T> > > lambdaToMethodOrProperty, Func <string> niceName) where T : Entity { dqm.RegisterExpression(lambdaToMethodOrProperty, niceName); return(fi); }
/// <summary> /// Uses NicePluralName as niceName /// </summary> public static FluentInclude <T> WithExpressionFrom <T, F>(this FluentInclude <T> fi, DynamicQueryManager dqm, Expression <Func <F, IQueryable <T> > > lambdaToMethodOrProperty) where T : Entity { dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NicePluralName()); return(fi); }
public static FluentInclude <T> WithQuery <T, Q>(this FluentInclude <T> fi, DynamicQueryManager dqm, Expression <Func <T, Q> > simpleQuerySelector) where T : Entity { dqm.RegisterQuery <Q>(typeof(T), () => Database.Query <T>().Select(simpleQuerySelector)); return(fi); }
public static FluentInclude <T> WithQuery <T, Q>(this FluentInclude <T> fi, DynamicQueryManager dqm, Func <DynamicQueryCore <Q> > lazyGetQuery) where T : Entity { dqm.RegisterQuery <Q>(typeof(T), () => lazyGetQuery()); return(fi); }
public static FluentInclude <T> WithQuery <T>(this FluentInclude <T> fi, DynamicQueryManager dqm, Func <Expression <Func <T, object> > > lazyQuerySelector) where T : Entity { dqm.RegisterQuery(typeof(T), new DynamicQueryBucket(typeof(T), () => DynamicQueryCore.FromSelectorUntyped(lazyQuerySelector()), Implementations.By(typeof(T)))); return(fi); }
/// <summary> /// Prefer WithExpressionFrom to keep dependencies between modules clean!. Uses NiceName as niceName. /// </summary> public static FluentInclude <F> WithExpressionTo <F, T>(this FluentInclude <F> fi, DynamicQueryManager dqm, Expression <Func <F, Lite <T> > > lambdaToMethodOrProperty) where F : Entity where T : Entity { dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NiceName()); return(fi); }