I have the following lambdas generated by reflection and need to know how to condense these into a single expression:
Current:
{((txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.Line1.Contains("Address 1"))) AndAlso
txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.Line2.Contains("Address 2")))) AndAlso
txliferequest.OLifE.Party.Any(party => party.Address.Any(address => address.City.Contains("City"))))}
Needed:
{((txliferequest.OLifE.Party.Any(party => party.Address.Any(address => {
address.Line1.Contains("Address 1") AndAlso
address.Line2.Contains("Address 2") AndAlso
address.City.Contains("City")
})
)}
Is there a way to do this using the Expression API? It says the final expression is not able to be reduced.