public static CreateMethodCallOperation ( |
||
type | ||
context | OperationContext | |
expression | ||
return | IOperation |
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { var method = expression.Method.GetGenericMethodDefinition(); if (method == QueryableAllMethod) { return(Operation.CreateMethodCallOperation(typeof(AllOperation <>), context, expression, 0)); } if (method == EnumerableAllMethod) { return(Operation.CreateMethodCallOperation(typeof(AllOperation <>), context, expression, 0)); } throw new NotImplementedException("All operation not found."); }
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { var method = expression.Method.GetGenericMethodDefinition(); if (method.GetGenericArguments().Length == 1 && method.GetParameters().Length == 1) { return(Operation.CreateMethodCallOperation(typeof(MaxOperation <>), context, expression, 0)); } if (method.GetGenericArguments().Length == 2 && method.GetParameters().Length == 2) { return(Operation.CreateMethodCallOperation(typeof(MaxWithProjectionOperation <,>), context, expression, 0, 1)); } throw new NotSupportedException("Max operation not found."); }
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { var method = expression.Method.GetGenericMethodDefinition(); if (method.GetGenericArguments().Length == 1 && method.GetParameters().Length == 1) { return(Operation.CreateMethodCallOperation(typeof(CountOperation <>), context, expression, 0)); } if (method.GetGenericArguments().Length == 1 && method.GetParameters().Length == 2) { return(Operation.CreateMethodCallOperation(typeof(CountOperationWithPredicate <>), context, expression, 0)); } throw new NotImplementedException("Count operation not found."); }
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { if (expression.Method.DeclaringType != typeof(Enumerable) && expression.Method.DeclaringType != typeof(Queryable)) { throw new InvalidOperationException("Requires Enumerable or Queryable method."); } var method = expression.Method.GetGenericMethodDefinition(); if (method.GetGenericArguments().Length == 1 && method.GetParameters().Length == 1) { return(Operation.CreateMethodCallOperation(typeof(CastOperation <>), context, expression, 0)); } throw new NotSupportedException("Cast operation not found."); }
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { return(Operation.CreateMethodCallOperation(typeof(DefaultIfEmptyOperation <>), context, expression, 0)); }
public static IOperation CreateOperation(OperationContext context, MethodCallExpression expression) { return(Operation.CreateMethodCallOperation(typeof(OrderByOperation <,>), context, expression, 0, 1)); }