Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

selecting members from a dictionary with Linq - Operator '&&' cannot be applied to operands of type 'int' and 'bool'

$
0
0

pack.Data.Values contains several dictionary objects.

It is passed into a method for further processing. In the method there is some linq code that returns a list of endPointIds:

dp.Select(d => d.EndpointId) 

Stuff is done with that list of endPoints.

I need to add an extra condition to that linq code to only get those where the doProcess flag is set to true.

doProcess is a nullable bool

dp.Select(d => d.EndpointId && d.doProcess.HasValue)

and also tried

dp.Select(d => d.EndpointId && (d.doProcess ?? true))

Either results in the error message from the title.

How to correct this?

TIA


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>