0
I created a Join in LINQ
to create a List
:
(from p in listaProcedimento
join pd in oListaprocedimentodetalhe on p.codigo equals pd.codigoProcedimento into pd1
from pd2 in pd1.DefaultIfEmpty()
select new ProcedimentoDetalhe()
{
codigoDetalhe = pd2.codigoDetalhe == null ? "000" : "012",
codigoProcedimento = p.codigo,
descricao = p.descricao,
idadeMax = p.idadeMax,
idadeMin = p.idadeMin
}).OrderBy(p => p.descricao)
.ToList();
I get the mistake by saying pd2 was null
, being that I have already tried to correct this in line: pd2.codigoDetalhe == null ? "000" : "012"
.
Because it’s not working?
You didn’t because you’re just listed the codes where
pd2 == "012"
. I’ll post the classes to detail the question– Italo Rodrigo
Exactly what I said, you asked a question, solved this problem, received 3 answers, now want to change the question and invalidate the 3 answers, can not.
– Maniero
I get it, I’m gonna ask another question then
– Italo Rodrigo