aspnet-identity-2-extensible-project-template's People
Forkers
gremoire charreal matthewtheobald rodrigoratan junyi0124 kegumx devocity-us jc9999jc diegobdev akluthe samlbest asapcomply likhi1 victorhenriquez tyeth farfaniriss rioka gitjcy modulexcite jristy1989 huyhoang9212 codebuger88 zhangrl mohamedbadr rabbyalone laniatech satishfied markchipman fhdk simonwaechter1aspnet-identity-2-extensible-project-template's Issues
Admin user and role in the seed() of ApplicationDbInitializer is not executed
Application runs well but did not see the seeded Admin 'User' and 'Role', please help.
Thanks,
Jwndev
ApplicationUser must be convertible to microsoft.aspnet.identity.framework.identityuser inorder to use it as parameter TUser
Thank you so much for the template. I am not very experienced program however manage to use the template. I am trying to import users information from an old project using SqlMembership, I need to use SQLPasswordHasher which I got from this example: http://www.asp.net/identity/overview/migrations/migrating-an-existing-website-from-sql-membership-to-aspnet-identity.
I am trying to add UserManger:
public MyUserManager ()
: base(new UserStore(new ApplicationDbContext()))
{
this.PasswordHasher = new SQLPasswordHasher();
}
I get the above error.
When I change the public class ApplicationUser : IdentityUser I don't get this error
I would appreciate your suggestions.
each line of above Register method that exist 'RoleManager' word I'm getting compile time error as below
// POST: /Account/Register
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Register(RegisterViewModel model, HttpPostedFileBase upload, params string[] selectedRoles)
{
try
{
if (ModelState.IsValid)
{
var user = new ApplicationUser { UserName = model.UserName, Email = model.Email };
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
//Add User to the selected Roles
if (selectedRoles != null)
{
var addroles = await UserManager.AddToRolesAsync(user.Id, selectedRoles);
if (!addroles.Succeeded)
{
ModelState.AddModelError("", result.Errors.First());
ViewBag.RoleId = new SelectList(await RoleManager.Roles.ToListAsync("Name", "Name"));
return View();
}
}
}
else
{
ModelState.AddModelError("", result.Errors.First());
ViewBag.RoleId = new SelectList(RoleManager.Roles, "Name", "Name");
return View();
}
return RedirectToAction("Index");
// AddErrors(result);
}
}
// If we got this far, something failed, redisplay form
catch (RetryLimitExceededException /* dex */)
{
//Log the error (uncomment dex variable name and add a line here to write a log.
ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
}
ViewBag.RoleId = new SelectList(RoleManager.Roles, "Name", "Name");
return View(model);
}
Using the generic type 'RoleManager' requires 2 type arguments
which means I'm getting 3 compile time errors in above method.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.