What is the most elegant way to inject UserManager and UserStore into a controller using ninject? For example, the context can be injected like this:
kernel.Bind<EmployeeContext>().ToSelf().InRequestScope();
public class EmployeeController : Controller
{
private EmployeeContext _context;
public EmployeeController(EmployeeContext context)
{
_context = context;
}
Can ninject inject UserManager and UserStore with a one line of code into a controller?! If not, what is the easiest way? I don't want to use this:
var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
Thank you in advance.