C# LINQ to SQL Except Operator
Posted
by kb
on Stack Overflow
See other posts from Stack Overflow
or by kb
Published on 2010-04-12T14:10:26Z
Indexed on
2010/04/12
14:13 UTC
Read the original article
Hit count: 465
Hi
i have a list of event Ids that i want to be excluded from my select statement, but no sure 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 for the events that have their eventId matching the EventShowCode value
i have looked at the except operator, but not sure how to implement it
thanks
© Stack Overflow or respective owner