DX.Data.Xpo.AutoMapper 26.1.3.36

dotnet add package DX.Data.Xpo.AutoMapper --version 26.1.3.36
                    
NuGet\Install-Package DX.Data.Xpo.AutoMapper -Version 26.1.3.36
                    
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="DX.Data.Xpo.AutoMapper" Version="26.1.3.36" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DX.Data.Xpo.AutoMapper" Version="26.1.3.36" />
                    
Directory.Packages.props
<PackageReference Include="DX.Data.Xpo.AutoMapper" />
                    
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 DX.Data.Xpo.AutoMapper --version 26.1.3.36
                    
#r "nuget: DX.Data.Xpo.AutoMapper, 26.1.3.36"
                    
#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.
#:package DX.Data.Xpo.AutoMapper@26.1.3.36
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DX.Data.Xpo.AutoMapper&version=26.1.3.36
                    
Install as a Cake Addin
#tool nuget:?package=DX.Data.Xpo.AutoMapper&version=26.1.3.36
                    
Install as a Cake Tool

DX.Data.Xpo.AutoMapper

AutoMapper-backed implementation of DX.Data.Xpo's abstract XPDataStore<TKey, TModel, TDBModel> — DTO ↔ XPO persistent-object mapping handled by AutoMapper instead of hand-written code.

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.34 this package no longer supports net462 — see Breaking Changes in the root README for why (AutoMapper CVE-2026-32933) and what to do if you can't move off net462 (use DX.Data.Xpo.Mapster instead).

Install

dotnet add package DX.Data.Xpo.AutoMapper

XPAutoMapperStore<TKey, TModel, TDBModel>

public class XPAutoMapperStore<TKey, TModel, TDBModel> : XPDataStore<TKey, TModel, TDBModel>
    where TDBModel : XPBaseObject
{
    public XPAutoMapperStore(IDataLayer dataLayer, IMapper mapper, IValidator<TDBModel> validator);

    public override IQueryable<T> Query<T>(); // Query(UnitOfWork).ProjectTo<T>(Mapper.ConfigurationProvider)
    protected override TDBModel ToDBModel(TModel model); // Mapper.Map<TDBModel>(model)
    protected override TModel ToModel(TDBModel dbModel);  // Mapper.Map<TModel>(dbModel)
    protected override TModel GetByKey(TKey key);          // Mapper.Map<TModel>(session.GetObjectByKey<TDBModel>(key))
}

This is a thin, fully-generic subclass of XPDataStore — all the mapping methods it overrides just delegate to the injected IMapper. Query<T>() uses AutoMapper's ProjectTo<T> (server-side projection, translated into the underlying SQL/criteria by AutoMapper's IConfigurationProvider), so filtering/paging happens in the database rather than in memory.

Usage

public class CustomerStore : XPAutoMapperStore<int, CustomerDto, XpoCustomer>
{
    public CustomerStore(IDataLayer dataLayer, IMapper mapper, IValidator<XpoCustomer> validator)
        : base(dataLayer, mapper, validator) { }
}

Register the IMapper the normal AutoMapper way (services.AddAutoMapper(...) with a Profile that maps CustomerDto <-> XpoCustomer), inject an IValidator<XpoCustomer> (FluentValidation), and resolve IDataLayer from XpoDatabase.GetDataLayer(...) or your DI container.

Notes

  • If your project must stay on net462, this package is not an option as of 26.1.3.34 — switch to DX.Data.Xpo.Mapster, which has no AutoMapper dependency and continues to support net462.
  • For MS Identity storage on top of XPO with AutoMapper wiring, see DX.Data.Xpo.Identity.AutoMapper.

See the root README for the full package list, the AutoMapper breaking-change notice, and DevExpress version alignment notes.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DX.Data.Xpo.AutoMapper:

Package Downloads
DX.Data.Xpo.Identity.AutoMapper

XPO Based storage provider for ASP.NET Identity with Automapper implementation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.1.3.36 125 8/6/2026
26.1.3.35 129 7/31/2026
26.1.3.34 144 7/14/2026
24.2.3.33 329 12/13/2024
24.1.6.33 238 9/25/2024
23.2.3.33 257 9/17/2024
23.2.3.32 236 9/17/2024
23.2.3.31 320 1/11/2024

26.1.3.36: Rebuilt against DX.Data.Xpo 26.1.3.38 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.Mapster, which still
supports net462 and does not depend on AutoMapper.
23.2.3.31: Data.DataStore plus Validator and Mapper have been moved and simplified into package DX.Data
BREAKING CHANGES:
Data base classes moved to DX.Data package
This store will use FluentValidation and AutoMapper for mapping
23.2.3.23: Upgraded to .NET8 and DX v23.2.3 Dropped support for .NETStandard!