• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post


QR Code

Tiny Url

http://4kcan.com/s/MjIw

Related Code
PagedList class and paging code for ASP.Net MVC (Nothing new but kind of usefull.)
Unity Service Locator for ASP.NET MVC 3.0 Beta 1
Fork of GZIP your Actions in MVC if not used as standard in IIS7 or only use IIS6
WCF Service factory for using Microsoft Unity 2.0 to create an instance of a Service
Google Analytics helper for ASP.NET Razor
WCF RIA Services Unity 2.0 DomainService Factory
UnitOfWork Action filter for ASP.NET MVC and nHibernate
Make sure the web.config pages/namespace can be used together with ASP.NET MVC 3 P1 and Razor
StringFormat Extension method for HtmlHelper ASP.NET MVC
HttpContextLifetimeManager for Unity
ASP.NET MVC 4.0 Web API Message logger for .Net 4.0
GZIP your Actions in MVC if not used as standard in IIS7 or only use IIS6
Extension to the HttpClient
Simple light ObjectFactory using Unity

Unity Controller Factory for ASP.NET MVC 3.0

This is a Unity 2.0 Controller Factory for ASP.NET MVC 3.0

1
1.61k 0 0 0 0 0

public class UnityMvcControllerFactory : IControllerFactory
{
    private readonly IUnityContainer _container;
    private readonly IControllerFactory _innerFactory;


    public UnityMvcControllerFactory(IUnityContainer container)
        : this(container, new DefaultControllerFactory())
    {
    }


    protected UnityMvcControllerFactory(IUnityContainer container, IControllerFactory innerFactory)
    {
        _container = container;
        _innerFactory = innerFactory;
    }


    public IController CreateController(RequestContext requestContext, string controllerName)
    {
        try
        {
            return _container.Resolve<IController>(controllerName.ToLowerInvariant());
        }
        catch
        {
            return _innerFactory.CreateController(requestContext, controllerName);
        }
    }


    public void ReleaseController(IController controller)
    {
        _container.Teardown(controller);
    }
}

Share: twitter | facebook   Action: used | fork | flag

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

controller

Mark 'controller' tag as 'like'

Mark 'controller' tag as 'ignore'

unity

Mark 'unity' tag as 'like'

Mark 'unity' tag as 'ignore'


 @fredrikn "I'm the master"
3.11k
August 01, 2010 9:31 AM

Fork

 Unity Controller Factory for ASP.NET MVC 3.0 -  @fredrikn Sunday 01, 2010 9:31 AM


0 Feedback


You must log in before you can give any feedback


0 Discussion(s)

Newest Oldest

You must log in before you can post a comment

Squeed
Made by: Fredrik Normén 2010