Skip to content

Commit dfe8d4f

Browse files
committed
Upadate ReadMe.md and adds that file to the package.
1 parent 8c43a11 commit dfe8d4f

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
# AspNetCore.Identity.Marten
22
.Net Core Identity Stores using Marten
3+
4+
The users and roles stores are tested by using the offical Microsoft.AspNetCore.Identity.Specification.Tests packages. Have a look at the Marten.AspNetCore.Identity.Tests project.
5+
To run the tests you should have docker installed. A PostgreSQL image will be automatically downloaded and used during the test.
6+
7+
8+
# How to configure it
9+
10+
This repository has a small example project which setup the Microsoft Identity to use this package.
11+
12+
13+
1. Add this [package](https://www.nuget.org/packages/Marten.AspNetCore.Identity/) to your project.
14+
15+
2. While adding the default Marten support, you should configure the MartenIdentityUser and MartenIdentityRole entities:
16+
```c#
17+
builder.Services.AddMarten(options =>
18+
{
19+
options.Connection(builder.Configuration.GetConnectionString("Marten"));
20+
// Configure the MartenIdentityUser and MartenIdentityRole mappings
21+
options.ConfigureMartenIdentityMapping();
22+
if (builder.Environment.IsDevelopment())
23+
{
24+
options.AutoCreateSchemaObjects = AutoCreate.All;
25+
}
26+
});
27+
```
28+
29+
3. Add the MartenIdentityStores
30+
```c#
31+
builder.Services.AddMartenIdentityStores();
32+
```
33+
34+
4. Configure the default identity to be MartenIdentityUser.
35+
```c#
36+
builder.Services.AddDefaultIdentity<MartenIdentityUser>();
37+
```

source/Marten.AspNetCore.Identity/Marten.AspNetCore.Identity.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<Authors>Sörnt Poppe</Authors>
1111
<PackageTitle>Marten.AspNetCore.Identity</PackageTitle>
1212
<Description>A Marten UserStore and RoleStore adapter for Microsoft.Extensions.Identity.Core 6.</Description>
13+
<PackageReadmeFile>README.md</PackageReadmeFile>
1314
<PackageProjectUrl>http://www.opensource.org/licenses/mit-license.php</PackageProjectUrl>
1415
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1516
<Copyright>Copyright 2021 (c) Sörnt Poppe. All rights reserved.</Copyright>
@@ -21,6 +22,10 @@
2122
-->
2223
</PropertyGroup>
2324

25+
<ItemGroup>
26+
<None Include="../../README.md" Pack="true" PackagePath="\"/>
27+
</ItemGroup>
28+
2429
<PropertyGroup>
2530
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
2631
</PropertyGroup>

0 commit comments

Comments
 (0)