Items = (from myRow in table.AsEnumerable()
where myRow.Field<string>("RelatedContactName") == groupName
select myRow)
设置对象的属性。
public class Item
{
public List<Item> Items
{
get;
set;
}
}
答案 0 :(得分:1)
您需要在select
子句中创建一个新对象:
select new Item { ... }
答案 1 :(得分:-1)
Items = (from myRow in table.AsEnumerable()
where myRow.Field<string>("RelatedContactName") == groupName
select myRow).ToList();