我是 C# ASP.NET 的新手,我正在尝试从商店 (EPiServer) 获取商品。
视觉工作室说
无法解析符号 Where、OnderzoekId 和 ToList
我究竟做错了什么?我使用了这个代码示例:
[EPiServerDataStore(AutomaticallyCreateStore = true, AutomaticallyRemapStore = true)]
public class OnderzoekColumn
{
private static int Counter = 0;
public Identity Id { get; set; }
public int ColumnId { get; set; }
public int OnderzoekId { get; set; }
public string ColumnName { get; set; }
public OnderzoekColumn()
{
Initialize();
}
public OnderzoekColumn(int onderzoekId, string columnName)
{
Initialize();
OnderzoekId = onderzoekId;
ColumnName = columnName;
}
protected void Initialize()
{
Id = Identity.NewIdentity(Guid.NewGuid());
ColumnId = System.Threading.Interlocked.Increment(ref Counter);
OnderzoekId = 0;
ColumnName = string.Empty;
}
public static List<OnderzoekColumn> GetOnderzoekColumns(int onderzoekId)
{
var store = typeof(OnderzoekColumn).GetStore();
var columns = from c in store
where c.OnderzoekId == onderzoekId
select c;
if (columns == null)
{
return new List<OnderzoekColumn>();
}
return columns.ToList<OnderzoekColumn>();
}
}