DX.Data.Xpo.Identity.AutoMapper
26.1.3.36
dotnet add package DX.Data.Xpo.Identity.AutoMapper --version 26.1.3.36
NuGet\Install-Package DX.Data.Xpo.Identity.AutoMapper -Version 26.1.3.36
<PackageReference Include="DX.Data.Xpo.Identity.AutoMapper" Version="26.1.3.36" />
<PackageVersion Include="DX.Data.Xpo.Identity.AutoMapper" Version="26.1.3.36" />
<PackageReference Include="DX.Data.Xpo.Identity.AutoMapper" />
paket add DX.Data.Xpo.Identity.AutoMapper --version 26.1.3.36
#r "nuget: DX.Data.Xpo.Identity.AutoMapper, 26.1.3.36"
#:package DX.Data.Xpo.Identity.AutoMapper@26.1.3.36
#addin nuget:?package=DX.Data.Xpo.Identity.AutoMapper&version=26.1.3.36
#tool nuget:?package=DX.Data.Xpo.Identity.AutoMapper&version=26.1.3.36
DX.Data.Xpo.Identity.AutoMapper
Wires up DX.Data.Xpo.Identity's abstract stores with AutoMapper and a set of default XPO persistent entities, so you can register full ASP.NET Core Identity support with a single DI call.
Target frameworks: net471, net8.0, net9.0, net10.0
DevExpress dependency: transitive, via DX.Data.Xpo (26.1.*)
⚠ Requires .NET Framework 4.7.1 or higher. As of
26.1.3.34this package no longer supports net462 — see Breaking Changes in the root README (AutoMapper CVE-2026-32933). If you need net462, useDX.Data.Xpo.Identity.Mapsterinstead.
Install
dotnet add package DX.Data.Xpo.Identity.AutoMapper
Install this or DX.Data.Xpo.Identity.Mapster — never both (see the root README).
Concrete stores (XPIdentityStores.cs, #if NETCOREAPP)
Six concrete classes, one per Identity concern, each : XPBaseXxxStore<...> from DX.Data.Xpo.Identity implementing Query<T>() via AutoMapper's ProjectTo<T> and GetByKey via Mapper.Map:
public class XPAutoMapperUserStore<...> : XPBaseUserStore<...> { public XPAutoMapperUserStore(IDataLayer, IMapper, IValidator<TXPOUser>); }
public class XPAutoMapperRoleStore<...> : XPBaseRoleStore<...> { /* ... */ }
public class XPAutoMapperUserLoginStore<...> : XPBaseUserLoginStore<...> { /* ... */ }
public class XPAutoMapperUserClaimStore<...> : XPBaseUserClaimStore<...> { /* ... */ }
public class XPAutoMapperUserTokenStore<...> : XPBaseUserTokenStore<...> { /* ... */ }
public class XPAutoMapperRoleClaimStore<...> : XPBaseRoleClaimStore<...> { /* ... */ }
One-line registration (RegisterServices.cs)
public static IServiceCollection AddXpoAutoMapperIdentityStores<TUser>(this IdentityBuilder builder, string connectionName);
// + overloads with progressively more generic type parameters if you supply your own
// persistent XPO entity classes instead of the defaults (XpoDxUser, XpoDxRole, etc. from
// DX.Data.Xpo.Identity.Persistent)
Calling this:
- Registers AutoMapper (
services.AddAutoMapper(cfg => cfg.AddProfile(new XPIdentityMapperProfile<...>()))) if it isn't already registered. - Registers a singleton
IDataLayerresolved fromXpoDatabase.GetDataLayer(connectionName). - Calls
RegisterXPIdentityValidators<...>()to register the six FluentValidation validators. - Registers all six
IQueryable*Storeservices as scoped. - Calls
RegisterIdentityServices.AddStores<TKey>(...), which builds and registers the actualIUserStore<TUser>/IRoleStore<TRole>implementations.
XPIdentityMapperProfile<...> (also in RegisterServices.cs) is the AutoMapper Profile used in step 1 — it maps between the Identity model types and the XPO persistent types in both directions, deliberately ignoring collection-navigation properties (RolesList, ClaimsList, TokenList, LoginsList) since those are managed by the store methods, not by a flat object-to-object map.
Usage
services
.AddIdentity<ApplicationUser>(options => { /* lockout, password policy, etc. */ })
.AddXpoAutoMapperIdentityStores<ApplicationUser>("DefaultConnection")
.AddDefaultTokenProviders();
That's the entire registration — no manual mapper profile, validator, or store wiring required for the default persistent entity classes. See the root README for the full config sample including JWT/token service setup used alongside DX.Blazor.Identity.
Notes
- If you need to use your own XPO persistent classes instead of the built-in
XpoDxUser/XpoDxRole/etc., use one of the more-genericAddXpoAutoMapperIdentityStoresoverloads and supply your ownTXPOUser/TXPORole/... type arguments — AutoMapper will need corresponding map configuration for them (extend or replaceXPIdentityMapperProfile). - For Blazor Server/WASM login UI on top of this, see
DX.Blazor.Identity.
See the root README for the full package list, the AutoMapper breaking-change notice, and DevExpress version alignment notes.
| Product | Versions 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 is compatible. 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. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.1
- AutoMapper (>= 16.2.0)
- DX.Data.Xpo (>= 26.1.3.38)
- DX.Data.Xpo.AutoMapper (>= 26.1.3.36)
- DX.Data.Xpo.Identity (>= 26.1.3.37)
-
net10.0
- AutoMapper (>= 16.2.0)
- DX.Data.Xpo (>= 26.1.3.38)
- DX.Data.Xpo.AutoMapper (>= 26.1.3.36)
- DX.Data.Xpo.Identity (>= 26.1.3.37)
-
net8.0
- AutoMapper (>= 16.2.0)
- DX.Data.Xpo (>= 26.1.3.38)
- DX.Data.Xpo.AutoMapper (>= 26.1.3.36)
- DX.Data.Xpo.Identity (>= 26.1.3.37)
-
net9.0
- AutoMapper (>= 16.2.0)
- DX.Data.Xpo (>= 26.1.3.38)
- DX.Data.Xpo.AutoMapper (>= 26.1.3.36)
- DX.Data.Xpo.Identity (>= 26.1.3.37)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
26.1.3.36: Rebuilt against DX.Data.Xpo.Identity 26.1.3.37 / DX.Data.Xpo.AutoMapper 26.1.3.36 to pick up the System.Security.Cryptography.Xml 8.0.4 fix (NU1903) transitively.
26.1.3.35: Added a README.md with technical documentation, now embedded in the package via PackageReadmeFile.
26.1.3.34: Upgrade to DevExpress v26.1.3
BREAKING CHANGES:
Dropped .NET Framework 4.6.2 support. Minimum .NET Framework target is now 4.7.1 (net471).
This was required to move AutoMapper from 10.1.1 to 16.x, which patches a high-severity Denial-of-Service
vulnerability (CVE-2026-32933 / GHSA-rvv3-g6hj-g44x, uncontrolled recursion on deeply nested/circular
object graphs) present in AutoMapper 10.1.1 and every version below 15.1.3/16.1.1. AutoMapper no longer
publishes any release that supports .NET Framework below 4.7.1, so there is no version that is both
patched and net462-compatible.
If you cannot move your project off net462, do not take this update. Stay on the previous package
version (accepting the AutoMapper vulnerability), or switch to DX.Data.Xpo.Identity.Mapster, which
still supports net462 and does not depend on AutoMapper.