You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Web api project and tried to use this but get several issues
When I insert
this.UserManager = new UserManager(new UserStore("Mongo"));
In the default constructor I get
Severity Code Description Project File Line
Error CS0266 Cannot implicitly convert type 'Microsoft.AspNet.Identity.UserManager<WebApplication2.Models.ApplicationUser>' to 'WebApplication2.ApplicationUserManager'. An explicit conversion exists (are you missing a cast?) WebApplication2 C:\Git\Foosball9000\WebApplication2\Controllers\AccountController.cs 30
In IdentityConfig and Startup.Auth.cs there is a reference to ApplicationDbContext which I deleted, what should that be replaced with?
RegisterExternal in Accountcontroller have
var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
But email is not defined in ApplicationUser, should that just be replaced with Id?
Hope this project is not dead :)
The text was updated successfully, but these errors were encountered:
@Mech0z I just recently started using the code, so no expert here.
What I did, instead of instantiating "UserManager" I instantiated "ApplicationUserManager.
So my manager lines looks as follows:
var manager = new ApplicationUserManager(new UserStore("Mongo"));
By the way, the user store on this project does not implement IUserEmailStore, IUserPhoneNumberStore, IUserTwoFactorStore, and IUserLockoutStore. So if you are using any of the templates that come with single user authentication, you will get errors. Just implement them on your own.
I have created a Web api project and tried to use this but get several issues
When I insert
this.UserManager = new UserManager(new UserStore("Mongo"));
In the default constructor I get
Severity Code Description Project File Line
Error CS0266 Cannot implicitly convert type 'Microsoft.AspNet.Identity.UserManager<WebApplication2.Models.ApplicationUser>' to 'WebApplication2.ApplicationUserManager'. An explicit conversion exists (are you missing a cast?) WebApplication2 C:\Git\Foosball9000\WebApplication2\Controllers\AccountController.cs 30
In IdentityConfig and Startup.Auth.cs there is a reference to ApplicationDbContext which I deleted, what should that be replaced with?
RegisterExternal in Accountcontroller have
var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
But email is not defined in ApplicationUser, should that just be replaced with Id?
Hope this project is not dead :)
The text was updated successfully, but these errors were encountered: