I have a list of event IDs that I want to exclude from my select statement, but don't know how to implement this:
this is what stores my list of event ids
List<int> ExcludedEvents;
and this is my select statement (from an XML feed)
var allEvents = from eventsList in xmlDoc.Elements("shows").Elements("Show") select new EventFeed() { EventName = eventsList.Attribute("Name").Value, EventSummary = eventsList.Attribute("ShortDesc").Value, EventDetails = eventsList.Attribute("LongDesc").Value, EventShowCode = eventsList.Attribute("Code").Value };
I want to select all events except events for which their eventId matches the value of EventShowCode
I looked at the except statement, but not sure how to implement it
linq except
kb.
source share