1.2 KiB
1.2 KiB
RavenDB.AspNetCore.Identity
An ASP.NET Core Identity provider for RavenDB
Instructions
- In Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
// Add RavenDB and identity.
services
.AddRavenDb(Configuration.GetConnectionString("RavenDbConnection")) // Create a RavenDB DocumentStore singleton.
.AddRavenDbAsyncSession() // Create a RavenDB IAsyncDocumentSession for each request.
.AddRavenDbIdentity<AppUser>(); // Use Raven for users and roles. AppUser is a simple DTO to hold our user data. See https://github.com/JudahGabriel/RavenDB.AspNet.Identity/blob/master/Sample.Web.NetCore/Models/AppUser.cs
...
}
-
In your controller actions, call .SaveChanges when you're done making changes. Typically this is done via a RavenController base class.
-
You're done!
Need help? See the sample app