I need to compare and get the matching values from a string list with LINQ. Have a look at my code.
Code
Split = Id.Split(',');
List<string> uids = new List<string>(Split);
var model = (from xx in Db.ItemWeedLogs
where xx.ItemNo == uids
// I need to pass a string list to extract the matching record.
select xx).ToList();
Try this :
var model = (from xx in Db.ItemWeedLogs
where uids.Contains(xx.ItemNo)
select xx).ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With