Use Dependency Injection to resolve Sitecore View Rendering Models with Glass Mapper
In Sitecore MVC, a view rendering consists of a (Razor) view and optionally a model. The model has a definition item under and must be referenced in the field of the rendering definition item. Now when Sitecore is loading a view rendering, it starts the pipeline to create an instance of the referenced model and passes the model to the view. By default Sitecore creates the model instance with , which means that the class needs a default constructor and doesn’t allow constructor injection. John…