The Coding Humanist

Category: StructureMap

The purpose of a ValueProvider is to provide values from a source of data. There are several types of value providers built into the framework. They pull values from form posts, query strings, route data, posted files and other things. They exist to pull data from various data sources to supply to the model binding system so you can get your values on your action methods. But if you are reading this blog post, you probably already know what value providers are in ASP.NET MVC. So we will move on to getting them hooked up with our StructureMapDependencyResolver.

Read More on "StructureMap, Value Providers and Dependency Injection in ASP.NET MVC 3" >>

As you can tell by now, I’m not one who feels he has to avoid long titles for blog posts. We are continuing our work on exploring our options for dependency injection in ASP.NET MVC 3, with StructureMap as our IoC tool of choice. In our first post we got started with IDependencyResolver, in the second post we setup model binders and in the third we setup non-global action filters. In this post we will discuss global filters and the normal caveat applies: I have seen no clear guidance on this so I am kinda making this up as I go along. It works, but that is about all that I can promise you.

Read More on "StructureMap, Global Action Filters and Dependency Injection in ASP.NET MVC 3" >>

In our last post we setup the basic dependency resolver infrastructure for StructureMap. Our sample code is still hosted up on Github, so go get if you want to take a look at it. The same caveat to the last discussion still applies: since I know of no samples where StructureMap is used for a full implementation of the IoC hooks in ASP.NET MVC 3, I am kinda making it up as I go along. It is certainly working but time will tell how close my implementation ends up to being awesome. Now that this is out of the way, we need to push on because as is we are in little shape than we were in ASP.NET MVC 2 in terms of IoC support. So let’s start with getting dependency injection going for model binders.

Read More on "StructureMap, Model Binders and Dependency Injection in ASP.NET MVC 3" >>

I have become a big fan of the principle of dependency inversion over the last couple years. My tool of choice is StructureMap though I use Unity at work. It actually matters little which you use if you choose to use an IoC library. Much more important is your understanding of the principle and using that to make your software better. But this post is not here to discuss the meanings of these terms; its point is simple: How do you hook up StructureMap to ASP.NET MVC 3’s new IoC hooks?

Read More on "StructureMap and ASP.NET MVC 3 – Getting Started" >>