You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using navigation property the generated sql query ignores the projection requested and bring all columns (for both tables).
Also an order by clause is added to the query - but I guess this maybe relates to #6861 right?
Example:
Models:
public class Player
{
public string PlayerId { get; set; }
public string Nickname { get; set; }
public string CountryId { get; set; }
public Country County { get; set; }
}
public class Country
{
public string CountryId { get; set; }
public string Name { get; set; }
}
The query::
var playerInfo =
(from p in ctx.Players
where p.PlayerId == "123"
select new
{
Player = p.PlayerId,
Name = p.County.Name
})
.FirstOrDefaultAsync().Result;
The SQL generated:
SELECT p.PlayerId, p.CountryId, p.Nickname, p_County.CountryId, p_County.Name
FROM Players AS p
LEFT JOIN Countries AS p_County ON p.CountryId = p_County.CountryId
WHERE p.PlayerId = '123'
ORDER BY p.CountryId
LIMIT 1
Is this a known issue?
The text was updated successfully, but these errors were encountered:
When using navigation property the generated sql query ignores the projection requested and bring all columns (for both tables).
Also an order by clause is added to the query - but I guess this maybe relates to #6861 right?
Example:
Models:
The query::
The SQL generated:
Is this a known issue?
The text was updated successfully, but these errors were encountered: