What I'm trying to do is to add a new admin user and assign it with the admin role.
So.. I went to the Startup.cs class in Configure method and wrote the following code:
var context = app.ApplicationServices.GetService<ApplicationDbContext>();
// Getting required parameters in order to get the user manager
var userStore = new UserStore<ApplicationUser>(context);
// Finally! get the user manager!
var userManager = new UserManager<ApplicationUser>(userStore);
However, I get the following error message:
Severity Code Description Project File Line Suppression State Error CS7036 There is no argument given that corresponds to the required formal parameter 'optionsAccessor' of UserManager.UserManager(IUserStore, IOptions, IPasswordHasher, IEnumerable>, IEnumerable>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger>)' FinalProject..NETCoreApp,Version=v1.0 C:\Users\Or Natan\Documents\Visual Studio 2015\Projects\FinalProject\src\FinalProject\Startup.cs 101 Active
This error is killing me here.. obviously I need the userManager in order to create the new user but I just can't initialize this thing.