0

I am using Glass Mapper first time into my Sitecore 8.1 project. I am trying to use search functionality using Glass. I have checked the tutorial for Glass (http://glass.lu/Mapper/Sc/Tutorials/Tutorial25) but that throws an error ("var attributes = new SitecoreAttributeConfigurationLoader("glass.sitecore7");").

Anyone has example which works with Sitecore 8.1.

Thanks

jammykam
  • 16,940
  • 2
  • 36
  • 71
  • 1
    Please edit your post to include the exact error message with the stack trace. – Dmytro Shevchenko Sep 15 '16 at 13:31
  • It says assembly not found Glass.Sitecore7. I am using Sitecore 8.1 and Glass 4 –  Sep 15 '16 at 13:41
  • @DmytroShevchenko, thanks for your response, basically I want to get glass model/object which contains custom properties from search result. Any idea how can I do that? Thanks –  Sep 15 '16 at 13:45

1 Answers1

0

The search example is set up to use fluent configuration and the sample is also trying to pre-load all the models when the application starts up.

Which is the following lines in the sample:

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

The error you are seeing is because you have not updated the example to your specific project.

You need to update the name of the library to match your project that contains your classes, e.g.

var attributes = new SitecoreAttributeConfigurationLoader("MyProject.Models");
jammykam
  • 16,940
  • 2
  • 36
  • 71
  • Update your original question with the relevant code snippets. As you have found, comments are not a good place for this and do not help other people (trying to help you) either. – jammykam Sep 15 '16 at 15:01