Reputation: 11
here is my query
var traj_of_user_2=
from num in trajectoryArray
where num.ID_User == 2
select num.ID_Traj;
when i run the program, an exception appears (see the image)
what's the problem is your opinion? a friend of me told me that since the array is "lazy" there are no istances
Upvotes: 1
Views: 66
Reputation: 7449
Only get ID_User
when num != null
var traj_of_user_2=
from num in trajectoryArray
where (num != null && num.ID_User == 2)
select num.ID_Traj;
Upvotes: 0
Reputation: 14086
There is a null
in the array, and num.ID_User
is failing. You can filter out nulls like this:
var traj_of_user_2=
from num in trajectoryArray
where num != null &&
num.ID_User == 2
select num.ID_Traj;
Upvotes: 1