I have a List<Broadcast> and the Broadcast object has a property called Guid. Now I need to find all Broadcast objects in that list whose Guid property is not an item in List<Guid>.
I've found a solution with Except(); but it's not working for me.
Broadcasts.Where(x => x.Guid).Except(readBroadcasts);
What am I doing wrong?
Here is a way you can do it :
List<Guid> excludeGuid = ..... // You init guids you want to exclude
List<Broadcast> result = Broadcasts.Where(x => !excludeGuid.Contains(x.Guid)).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