Dependency injection in views..

Jan 25, 2012 at 11:16 PM

I have been looking online how to use DI in razor views and I found you need to do something like below and inherit from this class. The thing is all the examples have an Attribute on top of the get;set; property below like [Inject]. [Dependency] ,etc. What do you use for Munq?? Does it support View dependency injection like Unity, and Ninject do??

public abstract class InjectedView<TModel> : WebViewPage<TModel>
    {

        [Inject]
        public IUserRepository InjectedInterfaceInstance { get; set; }
    }

Coordinator
Mar 1, 2012 at 2:55 PM

No at the moment.  I'll look into it.