Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Navigation [hide] [expand]
Area: Optimizely Search & Navigation
ARCHIVED This content is retired and no longer maintained. See the latest version here.

How it works

When objects returned in search results are deserialized, they are instantiated by the JSON.NET serializer. If you require some custom action when you instantiate the objects, you can customize the instantiation with the Client conventions.

Example

An example of configuring custom instantiation can look like this:

C#
//using EPiServer.Find.ClientConvetions;

client.Conventions.ForType<BlogPost>()
    .CreateUsing(() => new BlogPost("someCtorParamValue"));

Note: If indexed objects are so complex that they require custom instantiation, they are often not suitable as search results and it might be better to project the search results to some other simpler class using the Select method.

Last updated: Nov 16, 2015