Dependency Injection Structuremap ASP.NET Identity MVC 5

前端 未结 3 1559
慢半拍i
慢半拍i 2020-12-29 08:07

I\'m using the new ASP.NET MVC 5 Identity framework for authentication. I\'ve traditionally used StructureMap for dependency injection, but I\'m having problems wiring it u

3条回答
  •  臣服心动
    2020-12-29 08:43

    Adding [DefaultConstructor] Attribute will work.

    public class AccountController : Controller
    {
        private ApplicationSignInManager _signInManager;
        private ApplicationUserManager _userManager;
    
        [DefaultConstructor]  //This is the attribute you need to add on the constructor
        public AccountController()
        {
        }
       // Other implementations here..........
    }
    

提交回复
热议问题