how solve the OUTER APPLY is not supported problem in this LINQ query
im using LINQ to Entities with dotConnect for Oracle and i get an OUTER APPLY is not supported exception with this very simple LINQ query:
from intervenant in Intervenants
select new
{
intervenant.Code,
intervenant.Nom,
Municipalite = intervenant.Adresses.Any() ? intervenant.Adresses.FirstOrDefault().Municipalite : string.Empty,
CodePostal = intervenant.Adresses.Any() ? intervenant.Adresses.FirstOrDefault().CodePostal : string.Empty
}
How should i build my query to solve this problem?
thank you very much for the help!
UPDATE
I have updated my devArt开发者_开发问答 dotConnect for Oracle provider and it have solved the problem. It doesn't do the OUTER APPLY anymore for this LINQ query.
BUT i have another problem. This linq query serve a Telerik Grid and the Outer Apply problem came back. Not sure what the Grid do inside but he is doing something that is not supported by the provider.
What happens when you do this?
from intervenant in Intervenants
select new
{
intervenant.Code,
intervenant.Nom,
Municipalite = intervenant.Adresses.FirstOrDefault().Municipalite,
CodePostal = intervenant.Adresses.FirstOrDefault().CodePostal
}
Can you then nest that inside a LINQ expression that converts the nulls to empty strings?
精彩评论