我是一名有用的助手,可以为您翻译文本。
我有一个事件 ID 列表,想要从我的 select 语句中排除它们,但不确定如何实现:
这是存储事件 ID 列表的代码:
我有一个事件 ID 列表,想要从我的 select 语句中排除它们,但不确定如何实现:
这是存储事件 ID 列表的代码:
List<int> ExcludedEvents;
以下是我的选择语句(来自XML源):
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
};
我希望选择除了eventId与EventShowCode值匹配的事件之外的所有事件。
我已经查看了except运算符,但不确定如何实现它。