I'm encountering a problem using LINQ
, I'm not very aware 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();
In the part below, I need this condition to be OR
and not AND
.
How do I do it?
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
}