/// <summary> /// Resolves types for the specified expression. /// </summary> /// <param name="expression">The expression to resolve types for.</param> /// <returns>Expression with resolved types.</returns> public QueryExpression Visit(LinqJoinExpression expression) { var outer = this.ResolveTypes(expression.Outer); var inner = this.ResolveTypes(expression.Inner); var outerType = ValidateSourceIsACollection(outer); var innerType = ValidateSourceIsACollection(inner); var outerKeySelector = this.ResolveLambdaTypes(expression.OuterKeySelector, outerType); var innerKeySelector = this.ResolveLambdaTypes(expression.InnerKeySelector, innerType); var resultSelector = this.ResolveLambdaTypes(expression.ResultSelector, outerType, innerType); return(LinqBuilder.Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, resultSelector.Body.ExpressionType.CreateCollectionType())); }