Skip to content

Commit 9730bb6

Browse files
authored
Merge pull request #6 from soernt/develop
Develop
2 parents 5f039d4 + 5e94216 commit 9730bb6

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

.github/workflows/build_test_deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
- name: Build Release version
4747
run: dotnet build --no-restore --configuration Release /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.Sha }}
4848

49-
# - name: Run Tests
50-
# run: dotnet test --configuration Release --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings Marten.AspNetCore.Identity.Tests/coverlet.runsettings
49+
- name: Run Tests
50+
run: dotnet test --no-restore --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --settings Marten.AspNetCore.Identity.Tests/coverlet.runsettings
5151

5252
- name: Pack
53-
run: dotnet pack --no-build --output ./output --configuration Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
53+
run: dotnet pack --no-restore --no-build --configuration Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }} --output ./output
5454

5555
- name: Upload Package to job as artificat
5656
uses: actions/upload-artifact@v2
@@ -61,7 +61,7 @@ jobs:
6161
if-no-files-found: error
6262

6363
- name: Upload Package to release
64-
# if: contains(github.ref, 'main')
64+
if: contains(github.ref, 'main')
6565
uses: svenstaro/upload-release-action@v1-release
6666
with:
6767
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -72,5 +72,5 @@ jobs:
7272
overwrite: true
7373

7474
- name: Upload Package to nuget
75-
# if: contains(github.ref, 'main')
75+
if: contains(github.ref, 'main')
7676
run: dotnet nuget push ./output/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1-
![build](https://github.com/soernt/AspNetCore.Identity.Marten/actions/workflows/build_and_test.yml/badge.svg)
1+
![build](https://github.com/soernt/AspNetCore.Identity.Marten/actions/workflows/build_test_deploy.yml/badge.svg)
22

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

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)