I would be grateful if someone could explain this following LINQ expression:
Endpoint adapter = (from adap in this
where
(endpointName == DEFAULT_ENDPOINT_NAME && adap.IsDefault) ||
(endpointName != DEFAULT_ENDPOINT_NAME && adap.Name == endpointName)
select adap).FirstOrDefault();
I can pretty much get the gist of this, I just need help with the from adap in this section. I would’ve expected this would be selecting from the current class – but I can’t find anything within the current class that’s a collection. Could you point me to where the data is likely to be coming from, adap?
The class the code resides in implements
IEnumerable<T>orIQueryable<T>as that is needed for it be to able to call the IEnumerable.Where or IQueryable.Where method.