iscivanomar
asked on
How to get the first row of a Matrix with LINQ
Hello everyone,
I need to see if the pallet is stackable or not. If I get two pallets the following LINQ work fine but if we have only one pallet with information does not work.
I need to get the single pallet two if is Stackable.
Please see the picture for better explanation.
Thank you
LinqMatrix.png
I need to see if the pallet is stackable or not. If I get two pallets the following LINQ work fine but if we have only one pallet with information does not work.
var stackableUDC = (from ms in Model.CurrentMissions
where (ms.CurrentStationId == StationId
&& ms.Lgv.Station.Positions.Select(y => y.TrackingId > 0
&& y.TrackingInfo.StackableType > 0
&& y.TrackingInfo.StackableType == (int)EStackableType.doubleStack
&& y.TrackingInfo.StackableType != (int)EStackableType.singleStack
).First()
)
orderby ms.Lgv.Station.Positions
select ms.Lgv.Station.Positions
).FirstOrDefault();
I need to get the single pallet two if is Stackable.
Please see the picture for better explanation.
Thank you
LinqMatrix.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello srinipro,
I break the LINQ SQL as you said and it work. I was able to check and compare the data more easily. Thank you again and have a good day.
I break the LINQ SQL as you said and it work. I was able to check and compare the data more easily. Thank you again and have a good day.
ASKER
sorry to get back to you until today. I went to other project for two days.
I breaked down to this:
Open in new window
however, I am getting an error called:
failed to compare two elements in the array in the second LINQ.
I am not using IComparable. what does this mean?
Thank you