Articles : Page 1 of 1

  • Injectable, Configurable Action Filters

    Injectable, Configurable Action Filters

    Jan 11
    20

    One of the advantages to using a custom IFilterProvider is how you gain total control over the instantiation of action filters in ASP.NET MVC 3. When you combine an IoC container with a filter provider and a custom IDependencyResolver (see Brad's posts for details),  then all the pieces fall into place. Building on the code from the last post, we can change our filter provider to utilize Ninject for action filter instantiation. public class ConfiguredFilterProvider : IFilterProvider { priva...


  • Contextual Awareness - Making your container behave intelligently

    Contextual Awareness - Making your container behave intelligently

    Sep 10
    17

    Containers are dumb - what if they were smart? One of the things I really wanted to do when I set out to create the ServiceLocator in Siege.Requisitions was to create a container that could map an interface to multiple types, and then at runtime, automatically figure out which one of those types I really wanted. To accomplish this, I put at it's core a small rule engine to allow users to create rules that would help the container understand how to pick implementations. It works great -- but th...


  • Dependency Injection into Controller Actions in ASP.NET MVC

    Dependency Injection into Controller Actions in ASP.NET MVC

    Sep 10
    17

    Dependency Injection into Controller Actions in ASP.NET MVC Where I work, we use Siege for all of our new (and most of our existing) web applications, taking advantage of it's contextual resolution capabilities to focus on programming our applications and less on making them compatible with our container by generating types and interfaces specifically for distinction by the container. One of the things that we came to realize was that for several of our controllers, the constructor depende...


  • ServiceLocator in ASP.NET MVC 3 – Part 2

    ServiceLocator in ASP.NET MVC 3 – Part 2

    Aug 10
    21

    In my earlier post I had discussed about the Common Service Locator framework (IServiceLocator interface)and how we can implement an adapter for the StructureMap container.In this post we will take look into how the new ASP.NET MVC provides support to plug in this ServiceLocator. The new framework supports an interface System.Web.Mvc.IMvcServiceLocator which is defined as: [...]...


  • ServiceLocator in ASP.NET MVC 3 Preview 3 – Part 1

    ServiceLocator in ASP.NET MVC 3 Preview 3 – Part 1

    Aug 10
    08

    For past couple of days I was checking out features of the new ASP.NET MVC Preview 3.There are couple of interesting new additions like integration with the new Razor viewengine,improvements in Model Validation,AJAX support and Dependency Injection.In this post we will discuss on, how ASP.NET MVC 3 has streamlined the ability to register/retrieve objects/services in [...]...



  • 1