Skip to content

BenGGolden/GlassModelBinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glass Model Binding

This project implements ASP.NET model binding for Sitecore and Glass Mapper. It allows you to decouple your Sitecore MVC controllers from Glass Mapper by eliminating the need to derive from GlassController. Instead, you can pass your glass models to your action methods as parameters and they will be mapped and ready to go.

Setup

  1. Create abstractions for both your item models and your rendering parameter models. The project uses IGlassItem and IGlassRenderingParameters as examples. If you use the standard TDS code gen templates, you can use IGlassBase for the item models, but you will still need something for the parameter models.
  2. Add the following files to your project:
  1. Modify Pipelines/Loader/AddModelBinderProvider.cs to pass the appropriate types to GlassModelBinderProvider.
  2. Pass your models to your action methods as parameters shown in Controllers/ContentController.cs

About

ASP.NET MVC Model Binding for Sitecore & Glass Mapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages