Exemplo n.º 1
0
            protected override Expression VisitMethodCall(MethodCallExpression node)
            {
                // Ignore Includes here
                if (node.Method.Name == nameof(QueryableExtensions.IncludePlan))
                {
                    return(null);
                }

                bool matched = false;

                foreach (var matcher in _methodMatchers)
                {
                    if (matcher.TryMatch(node, this, out var op))
                    {
                        _parent.AddResultOperator(op);
                        matched = true;
                        break;
                    }
                }

                if (!matched)
                {
                    var method = node.Method;
                    throw new NotSupportedException($"Marten does not (yet) support the {method.DeclaringType.FullNameInCode()}.{method.Name}() method as a Linq selector");
                }

                return(null);
            }