0
I’m encountering a problem in the use of LINQ
, I don’t have much knowledge of how it does. I have the following code:
(from BEN in repositorioBEN.RetornaTodos()
join CON in repositorioCON.RetornaTodos() on BEN.Handle equals CON.Handle
join APO in repositorioAPO.RetornaTodos() on CON.Apolice.Handle equals APO.Handle
join PGD in repositorioPGD.RetornaTodos() on new
{
ben = BEN.Handle,
con = CON.Handle,
fam = BEN.Familia,
est = APO.NroDoEstipulante,
cor = APO.Corretor
}
equals new
{
ben = PGD.Beneficiario.Handle,
con = PGD.Contrato.Handle,
fam = PGD.Familia,
est = PGD.HandleApolice,
cor = PGD.Corretor
}
join TGE in repositorioTGE.RetornaTodos() on PGD.RegimeAtendimento.Handle.ToString() equals TGE.RegimeAtendimento
where (PGD.DataFinal >= DateTime.Now && PGD.DataInicial <= DateTime.Now && BEN.Handle == idBeneficiario && TGE.Handle == idEvento)
select new
{
QtdeDiasPagtoDiferenciado = PGD.QtdeDiasPagtoDiferenciado
})
.SingleOrDefault();
At the bottom, I need this condition to be OR
and not AND
.
How should I do?
join PGD in repositorioPGD.RetornaTodos() on new
{
ben = BEN.Handle,
con = CON.Handle,
fam = BEN.Familia,
est = APO.NroDoEstipulante,
cor = APO.Corretor
}
equals new
{
ben = PGD.Beneficiario.Handle,
con = PGD.Contrato.Handle,
fam = PGD.Familia,
est = PGD.HandleApolice,
cor = PGD.Corretor
}