Can I make a SearchResult into a RenderModel derived model?
I am working on the Search facility for my Umbraco MVC site ( build on 6.1.6 ) and I have managed to get an idea of the Examine stuff enough to get started.
The problem is that if I want to be able to integrate my Examine results with my existing display logic, I need to be able to turn a SearchResult object into my ViewModel type, and those all derive from RenderModel in order to provide a whole lot of Umbraco-related goodness, but I can't see a way to create a RenderModel without an IPublishedContent object, although my SearchResult contains all the fields I need.
Is there a way to do this, or do I have to create two- effectively identical- ViewModels, one derived from RenderModel the other entirely self-contained?
My solution was to create an IPublishedContent object that was created from a SearchResult. I couldn't find anything like this built in, but it wasn't a big trial to do it myself once I arrived at the strategy.
Can I make a SearchResult into a RenderModel derived model?
I am working on the Search facility for my Umbraco MVC site ( build on 6.1.6 ) and I have managed to get an idea of the Examine stuff enough to get started.
The problem is that if I want to be able to integrate my Examine results with my existing display logic, I need to be able to turn a SearchResult object into my ViewModel type, and those all derive from
RenderModel
in order to provide a whole lot of Umbraco-related goodness, but I can't see a way to create aRenderModel
without anIPublishedContent
object, although my SearchResult contains all the fields I need.Is there a way to do this, or do I have to create two- effectively identical- ViewModels, one derived from
RenderModel
the other entirely self-contained?My solution was to create an IPublishedContent object that was created from a SearchResult. I couldn't find anything like this built in, but it wasn't a big trial to do it myself once I arrived at the strategy.
is working on a reply...