Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vborovikov/identity
ASP.NET Core Identity storage providers that use Dapper
https://github.com/vborovikov/identity
aspnetcore aspnetcore-identity dapper mysql postgresql sql-server sqlite
Last synced: about 2 months ago
JSON representation
ASP.NET Core Identity storage providers that use Dapper
- Host: GitHub
- URL: https://github.com/vborovikov/identity
- Owner: vborovikov
- License: mit
- Created: 2023-11-06T02:00:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-29T16:49:45.000Z (3 months ago)
- Last Synced: 2024-11-09T17:19:01.372Z (about 2 months ago)
- Topics: aspnetcore, aspnetcore-identity, dapper, mysql, postgresql, sql-server, sqlite
- Language: C#
- Homepage:
- Size: 131 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spryer.AspNetCore.Identity
ASP.NET Core Identity storage providers that use Dapper.## Packages
| Package | Version | Downloads |
| --- | --- | --- |
| [Spryer](https://github.com/vborovikov/spryer) | [![NuGet](https://img.shields.io/nuget/v/Spryer.svg)](https://www.nuget.org/packages/Spryer) | [![Downloads](https://img.shields.io/nuget/dt/Spryer.svg)](https://www.nuget.org/packages/Spryer) |
| Spryer.AspNetCore.Identity | [![NuGet](https://img.shields.io/nuget/v/Spryer.AspNetCore.Identity.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity) | [![Downloads](https://img.shields.io/nuget/dt/Spryer.AspNetCore.Identity.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity) |
| Spryer.AspNetCore.Identity.SqlServer | [![NuGet](https://img.shields.io/nuget/v/Spryer.AspNetCore.Identity.SqlServer.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity.SqlServer) | [![Downloads](https://img.shields.io/nuget/dt/Spryer.AspNetCore.Identity.SqlServer.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity.SqlServer) |
| Spryer.AspNetCore.Identity.Sqlite | [![NuGet](https://img.shields.io/nuget/v/Spryer.AspNetCore.Identity.Sqlite.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity.Sqlite) | [![Downloads](https://img.shields.io/nuget/dt/Spryer.AspNetCore.Identity.Sqlite.svg)](https://www.nuget.org/packages/Spryer.AspNetCore.Identity.Sqlite) |## Usage
```csharp
public sealed class AppUser : IdentityUser
{
public AppUser()
{
// default Identity UI uses this ctor when registering new users
this.Id = Guid.NewGuid();
this.SecurityStamp = Guid.NewGuid().ToString();
}
}public sealed class AppRole : IdentityRole
{
public AppRole()
{
// default Identity UI uses this ctor when creating new roles
this.Id = Guid.NewGuid();
}
}// Program.cs
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ??
throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");builder.Services.AddSingleton(_ => SqlClientFactory.Instance.CreateDataSource(connectionString));
builder.Services
.AddIdentity(options => options.SignIn.RequireConfirmedAccount = true)
.AddDapperStores(options =>
{
options.UseSqlServer();
})
.AddDefaultUI()
.AddDefaultTokenProviders();
```