4
I have a table of Gestor
in the database where you store information of a user with Manager profile. In this table, I have two FK's
: uniaoId and schoolboy. Well, that manager MUST belong to a union and may or may not belong to a school.
That’s my problem. When I do Join with Ingl, it doesn’t bring managers who don’t belong to a school. I tried the next one, but it didn’t work:
var listaRelatorioEmail = (
from ge in db.Gestor
join uni in db.Uniao on ge.UniaoId equals uni.UniaoId into uni_join
from uni in uni_join.DefaultIfEmpty()
join es in db.Escola on ge.EscolaId equals es.EscolaId into es_join
from es in es_join.DefaultIfEmpty()
select new
{
UniaoNome = uni.Nome,
UniaoId = uni.UniaoId,
EscolaNome = es.Nome,
EscolaId = es.EscolaId,
}).ToList();
There is no left Join on LINQ.
– Igor Macedo