Action Filter Dependency Injection in ASP.NET MVC 3 RC2 with StructureMap

前端 未结 3 2453
广开言路
广开言路 2021-02-20 11:09

I\'ve been playing with the DI support in ASP.NET MVC RC2.

I have implemented session per request for NHibernate and need to inject ISession into my \"Unit

3条回答
  •  鱼传尺愫
    2021-02-20 11:31

    I don't know if it would help but with MVC 3 action filters are now cached instead of being instantiated new at the beginning of every request. So if you're injecting dependencies something in the constructor it won't work well. Could you post your implementation of FilterAttributeFilterProvider ?

提交回复
热议问题