|I use the following code for dependency injection of Register/Login controller. The problem is that I cannot use Repository pattern I have created previously.
private readonly UserManager<AppUser> _userManager;
private readonly SignInManager<AppUser> _signInManager;
private readonly IUserRepository _userRepository;
public HomeController(UserManager<AppUser> userManager, SignInManager<AppUser> signInManager, IUserRepository userRepository)
_userManager = userManager;
_signInManager = signInManager;
_userRepository = userRepository;
When I run the code, the following error is occured:
Quote:InvalidOperationException: Unable to resolve service for type 'CustomizedIdentity.Repositories.IUserRepository' while attempting to activate 'CustomizedIdentity.Controllers.HomeController'.
modified 6-Dec-21 14:00pm.