Setting up the AuthenticationRepository
Now we move on to the AuthenticationRepository
. This is the object that will handle access and storage using the UserManager
framework provided by the Identity.EntityFramework
library. Add in a new folder called Repositories
, then add a new file called AuthenticationRepository.cs
, and implement the following:
Note
The UserManager
class is a facade for providing identity management in any ASP.Net application
public class AuthenticationRepository : IDisposable { private AuthenticationContext authenticationContext; private UserManager<IdentityUser> userManager; public AuthenticationRepository() { authenticationContext = new AuthenticationContext(); userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>(authenticationContext)); } public async Task<IdentityResult> RegisterUser...