Query: Inner Join not generated when using custom projections or wrong alias when omitting custom projections #8043
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Recently, I saw that one of my queries actually sends two separate queries to the server, instead of sending one with an inner join in it. First, I thought that it was because of the projections, so I removed them, but got the following results:
Steps to reproduce
the following query is sent to the server :
and then comes the exception:
Which is expected, given that the [t2] alias is wrong in
SELECT [t].[BlogId], [t].[Url], [t2].[Content]
Further, if you add the projections
in query1, query2 and result the following queries are sent to the server:
instead of one query with a single inner join. Is that by design?
Maybe those are two separate issues.
BUT, If you omit the query1 and query2 variables, like:
everything is fine and the following query is generated:
Further technical details
EF Core version: 1.1.1 (tried with 1.1.0 - same result)
Database Provider: Microsoft.EntityFrameworkCore.SqlServer 1.1.1 (tried with 1.1.0 - same result)
Operating system: Win 8.1 64bit
IDE Visual Studio 2015 Update 3
I also tried those queries with EF 6.1.3 with and without custom projections, and the result was:
The text was updated successfully, but these errors were encountered: