LLBLGen Pro v2.6
Adapter
So I've filled up an entity collection: EntityCollection<QueueEntity>
I want to find all the QueueEntities inside that collection that have an NcsPriority of < 2.0, so I did this:
var lifeAndSafetyQueue = from cq in queue.CallQueue
where Convert.ToDouble(cq.CallLog.NcsPriority) < 2.0
select cq;
...just a little later, I attempt to "foreach" through that resultset. If the resultset is empty because there are no records where NcsPriority is less than 2.0, I get a
"Object reference not set to an instance of an object."
...error. The error is generated at the point when the lifeAndSafetyQueue is referenced in the foreach loop. I've tried wrapping the foreach loop in an "if" test:
if (lifeAndSafetyQueue.Count() > 0) {
...but then I get the error at that point. What's a programmer to do?