Ejemplo n.º 1
0
 private static void HandleDistinct(Select select, MethodCallExpression expression)
 {
     if (select.Distinct == null)
     {
         select.Distinct = new List <Distinct>();
     }
     select.Distinct.Insert(0, new Distinct {
         Projection = ProjectionVisitor <T> .CreateModel(expression.ArgumentAt(2)),
         Order      = expression.HasArguments(4) ? new OrderBy {
             Type       = OrderBy.SourceType.Projection,
             Projection = ProjectionVisitor <T> .CreateModel(expression.ArgumentAt(3)),
             Order      = expression.ConstantArgumentAt <Order>(4)
         } : null
     });
 }