Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 /// <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);
 }