aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 868 forks source link

RoleManager documentation and sample code #1909

Closed josejmoran closed 6 years ago

josejmoran commented 6 years ago

It is very hard to find something developers can hold on to start using this class. It will be great if we can find code sample on how to use and instantiate this class. I tried to create a razor page where I can CRUD roles, but when I try to instantiate this class in the confines of this razor page I get an error. I tried to use dependency injection, but it did not work. The problem is there is no documentation or guide on how is the proper place, proper way of using this class. You are left to try things you may now know is the right way or recommended way to use this class. For example I found the following description of the class but without a proper code sample or more explanation is hard to know where and how I have to use it.

public RoleManager (Microsoft.AspNetCore.Identity.IRoleStore store, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Identity.IRoleValidator> roleValidators, Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors, Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Identity.RoleManager> logger);

blowdart commented 6 years ago

See #1910