Verified .NET Quickstart
Use this path when you want the shortest supported Memberships setup before adding EF Core, Broker, or RBAC bridges.
What this path proves
- A host can create and accept invitations.
- Accepted invitations create an active membership.
- Active-tenant selection is available through the self endpoint surface.
- Authentication is required by default.
Install the minimum packages
dotnet add package PrimusSaaS.Memberships
dotnet add package PrimusSaaS.Memberships.AspNetCore
dotnet add package PrimusSaaS.Memberships.InMemory
Register services
using PrimusSaaS.Memberships.AspNetCore.DependencyInjection;
using PrimusSaaS.Memberships.DependencyInjection;
using PrimusSaaS.Memberships.InMemory.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthentication(/* your scheme */);
builder.Services.AddAuthorization();
builder.Services.AddPrimusMemberships();
builder.Services.AddPrimusMembershipsInMemory();
builder.Services.AddPrimusMembershipsAspNetCore();
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.MapPrimusMembershipEndpoints();
app.Run();
Expected flow
POST /primus/tenants/{tenantId}/invitationsto create an invitation.POST /primus/invitations/{invitationId}/acceptwith the returned token.GET /primus/memberships/me/tenantsreturns the user's active membership.GET /primus/memberships/me/active-tenantreturns the selected tenant after acceptance.
What this quickstart does not cover
- Durable EF Core persistence
- Host-level policy naming for self vs admin routes
- Multi-Tenancy exemption for invitation acceptance
- Identity Broker or RBAC bridge packages
Use the Integration Guide when you need those pieces.
Current run evidence
dotnet test sdk/dotnet/tests/PrimusSaaS.Memberships.Tests/PrimusSaaS.Memberships.Tests.csproj --no-restore --nologoCurrent run:65/65passed onnet8.0,net9.0, andnet10.0.sdk/dotnet/tests/PrimusSaaS.Memberships.Tests/Integration/MembershipEndpointsTests.csEndpoints_CreateAcceptInvite_AndReturnMembershipspassed in the current run.sdk/dotnet/tests/PrimusSaaS.Memberships.Tests/Integration/MembershipEndpointsTests.csEndpoints_RequireAuthentication_ByDefaultpassed in the current run.