Glass Mapper Sitecore 8.1 搜索内容 (ContentSearchManager)

Glass Mapper Sitecore 8.1 Search content (ContentSearchManager)

我是第一次在我的 Sitecore 8.1 项目中使用 Glass Mapper。我正在尝试使用 Glass 的搜索功能。我已经检查了 Glass (http://glass.lu/Mapper/Sc/Tutorials/Tutorial25) 的教程,但会引发错误 ("var attributes = new SitecoreAttributeConfigurationLoader("glass.sitecore7");")。

任何人都有适用于 Sitecore 8.1 的示例。

谢谢

搜索示例设置为在应用程序启动时使用 fluent configuration and the sample is also trying to pre-load all the models

示例中的以下几行是:

var attributes = new SitecoreAttributeConfigurationLoader("glass.sitecore7");
...
return new IConfigurationLoader[]{attributes, loader};

您看到的错误是因为您没有将示例更新到您的特定项目。

您需要更新库的名称以匹配包含您的 类 的项目,例如

var attributes = new SitecoreAttributeConfigurationLoader("MyProject.Models");