【发布时间】:2011-08-23 22:11:31
【问题描述】:
我有一个带有联系人列表的客户。此列表是一个 ISet 集合。我无法对其进行 Linq 查询。你能帮我解决这个问题吗?
谢谢,
public class Customer
{
public virtual Iesi.Collections.Generic.ISet<Contact> Contacts { get; set; }
}
Customer customer = session.Get(id);
customer.Contacts = // Error - customer.Contacts.Where(x => x.Id != contactId);
更新 1
试过这个:from p in customer.Contacts.AsEnumerable() where p.Id != id select p;
where.System.Collections.Generic.IEnumerable 错误'
到“Iesi.Collections.Generic.ISet”。
存在显式转换(您是否缺少演员表?)
【问题讨论】:
标签: c# linq nhibernate