I\'m using Unity successfully for all regular constructor injection such as repositories etc., but I can\'t get it working with the ASP.NET Identity classes. The setup is th
You also need to resolve the UserManager. The following is an example how you could do it with the UserManager and the RoleManager. In this sample I use the regular Unity 3 package instead of one of the derivates or bootstrappers (had some problems with them in the past).
AccountController
private readonly UserManager _userManager;
private readonly RoleManager _roleManager;
public AccountController(IUserStore userStore, IRoleStore roleStore)
{
_userManager = new UserManager(userStore);
_roleManager = new RoleManager(roleStore);
}
Unity Bootstrapper
var accountInjectionConstructor = new InjectionConstructor(new IdentitySampleDbModelContext(configurationStore));
container.RegisterType, UserStore>(accountInjectionConstructor);
container.RegisterType, RoleStore>(accountInjectionConstructor);