Marten.AspNetIdentity 8.0.14

dotnet add package Marten.AspNetIdentity --version 8.0.14
                    
NuGet\Install-Package Marten.AspNetIdentity -Version 8.0.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Marten.AspNetIdentity" Version="8.0.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Marten.AspNetIdentity" Version="8.0.14" />
                    
Directory.Packages.props
<PackageReference Include="Marten.AspNetIdentity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Marten.AspNetIdentity --version 8.0.14
                    
#r "nuget: Marten.AspNetIdentity, 8.0.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Marten.AspNetIdentity&version=8.0.14
                    
Install Marten.AspNetIdentity as a Cake Addin
#tool nuget:?package=Marten.AspNetIdentity&version=8.0.14
                    
Install Marten.AspNetIdentity as a Cake Tool

NuGet

MartenAspNetIdentity

MartenAspNetIdentity is a Marten DocumentDb implementation of Microsoft.AspNetCore.Identity.

Example usage

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
    services.AddLogging();

    string connectionString = "server=localhost;database=aspnetidentity;uid=aspnetidentity;pwd=aspnetidentity;";

    services.AddIdentity<ApplicationUser, IdentityRole>()
        .AddMartenStores<ApplicationUser, IdentityRole>(connectionString)
        .AddDefaultTokenProviders();

    // more service wireup...
}
  • ApplicationUser is your user class to store.
  • IdentityRole is the role to store.

This will create an IDocumentStore for you, create a database and using the connection string provided, and add it to your services. If you already have an IDocumentStore configured in your DI container, you can use the overload without the connection string, the MartenAspNetIdentity will use this for its managers:

services.AddIdentity<ApplicationUser, IdentityRole>()
        .AddMartenStores<ApplicationUser, IdentityRole>()
        .AddDefaultTokenProviders();

There is a full example in this repository under the Example project

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.14 602 10/28/2024
8.0.12 109 10/28/2024
1.0.33 2,751 11/12/2019
1.0.30 1,437 4/3/2019
1.0.29 1,312 12/17/2018
1.0.28 1,258 12/17/2018
1.0.27 1,292 12/16/2018
1.0.26 1,402 11/1/2018
1.0.25 1,301 10/31/2018
1.0.24 1,337 10/31/2018
1.0.23 1,392 10/8/2018
1.0.22 1,388 10/2/2018
1.0.21 1,361 9/30/2018
1.0.20 1,316 9/30/2018
1.0.19 1,634 6/20/2018
1.0.18 1,566 6/20/2018
1.0.17 1,617 6/19/2018