我试图从 ContentItem 中检索分类术语的完整列表,执行如下操作:
var product = Services.ContentManager.Get<ContentItem>(33);
foreach (var term in product.TermsPart.Terms.Where(x => x.Field == "MyIndex"))
{
...
}
有人能帮我吗?
我读到它是可能的,使用动态来做到这一点:
dynamic product = Services.ContentManager.Get<ContentItem>(33);
foreach (var term in product.MyIndex.Terms)
{
...
}
但我找不到正确的语法!