Lumi.Foundation.PipelineValueProvider is a module that helps you speed up Sitecore development for Controller Renderings and allow you to supply Sitecore context type objects to your Controller Actions.
Let me not bore you with the technical details but let’s skip to the results. We’ll slide into details as we go and you can leave the information train whenever you feel like it ;-)
This, is what it’s all about:
You have your Controller and Action for your Controller Rendering. You have a few parameters and then the SitecorePipelineValueProvider will step in and magically provide these values for you.
The pipeline valueprovider will kick off these pipelines if your parameters is named to either one of these:
The core package is equipped with some standard processors that will resolve the data if the generic Type matches the parameter Type:
This is where I think it gets interesting. My end game was to be able to have GlassType objects resolved for me and with this ValueProvider it would be easy to create custom processors for that. Lumi.Foundation.PipelineValueProvider.Glass is another package I’ve created and you can install it on top of the standard. When installed, your controller could then look like:
The contextItem will still be resolved by the default processor (like in the previous screenshot). But the datasource will not be resolved by the default processor and is handed over to the ResolveGlassDatasourceItem processor which nicely returns the datasource as a mapped Title object.
Oh and by the way, this works really well combined with the Code First Renderings module. It also has an affinity with Glass and uses the same naming conventions. Check it out: http://www.chrisvandesteeg.nl/2015/06/16/sitecore-codefirst-renderings/
If you prefer to use another ORM then you can just create add and replace processors to the pipelines. There are some base processors to help you get on your way:
But you don’t need to use either of them. The only thing you are required to use is the ValueProviderArgs. It contains 2 properties that are important:
Of course, the source and packages are available. Please drop a comment if you like, have questions or anything to add to this.