DX.Data 26.1.3.36

dotnet add package DX.Data --version 26.1.3.36
                    
NuGet\Install-Package DX.Data -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" 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" Version="26.1.3.36" />
                    
Directory.Packages.props
<PackageReference Include="DX.Data" />
                    
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 --version 26.1.3.36
                    
#r "nuget: DX.Data, 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@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&version=26.1.3.36
                    
Install as a Cake Addin
#tool nuget:?package=DX.Data&version=26.1.3.36
                    
Install as a Cake Tool

DX.Data

The base data-access abstraction shared by every store implementation in the DXWeb family (XPO, EF Core, Blazor WASM). Defines the IDataStore<TKey, TModel> contract that DX.Data.Xpo, DX.Data.EF, and their AutoMapper/Mapster variants all implement, plus a ready-to-use HTTP-based store for Blazor WASM clients. No DevExpress dependency.

Target frameworks: net462, net8.0, net9.0, net10.0

Install

dotnet add package DX.Data

You normally don't install this directly — it comes in transitively via DX.Data.Xpo, DX.Data.EF, or their mapper variants. Install it directly only if you're writing your own IDataStore implementation from scratch (e.g. against a different backend).

Core interfaces (Interfaces.cs)

public enum DataMode { Create, Update, Delete, Store }

public interface IDataStore<TKey, TModel>
{
    Task<IDataResult<TKey, TModel>> DeleteAsync(TKey key);
    string KeyField { get; }
    TKey GetByKey(TKey key); // returns the model, not just the key — see remarks
    TKey ModelKey(TModel model);
    void SetModelKey(TModel model, TKey key);
    Task<IDataResult<TKey, TModel>> StoreAsync(TModel model);
    Task<IDataResult<TKey, TModel>> CreateAsync(TModel model);
    Task<IDataResult<TKey, TModel>> UpdateAsync(TModel model);
}

public interface IQueryableDataStore<TKey, TModel> : IDataStore<TKey, TModel>
{
    IQueryable<TModel> PaginateViaPrimaryKey(IQueryable<TModel> query, int skip, int take);
    IQueryable<T> Query<T>();
    IQueryable<TModel> Query();
}

Every concrete store in the DXWeb family (XPDataStore<...> in DX.Data.Xpo, EFDataStore<...> in DX.Data.EF) implements IQueryableDataStore<TKey, TModel>. StoreAsync is the "upsert" entry point: pass a model with a default/empty key to insert, or an existing key to update — CreateAsync/UpdateAsync are explicit variants of the same underlying logic.

IDataResult<TKey, TModel> wraps the outcome of any of the above calls:

public interface IDataResult<TKey, TModel>
{
    bool Success { get; }
    DataMode Mode { get; }
    TModel? Model { get; }
    Exception? Exception { get; }
}

DataResult<TKey, TModel> is the concrete implementation, constructed as new DataResult<TKey, TModel>(mode, propertyName, exception) — check .Success before trusting .Model.

Other supporting interfaces:

  • IIdentityRefreshTokenRefreshToken / RefreshTokenExpiryTime properties, implemented by identity user models across DX.Data.Xpo.Identity and DX.Blazor.Identity so refresh-token flows work uniformly.
  • IAssignable — a marker for types that know how to copy their own state from a source object (Assign(object source)), used by the reflection-based PropertyExtensions.Assign in DX.Utils.
  • IDataMapper<TKey, TModel, TDBModel>[Obsolete]. Superseded by AutoMapper/Mapster-based mapping; kept only so old code referencing it still compiles.

ApiStore — Blazor WASM REST client (#if NET5_0_OR_GREATER)

public class ApiStore<TKey, TModel> : IDataStore<TKey, TModel>
{
    public ApiStore(HttpClient client, string route);
    // implements CreateAsync/UpdateAsync/StoreAsync/DeleteAsync via HTTP POST/PUT/DELETE
}

A drop-in IDataStore implementation for Blazor WASM (or any client-side .NET) that talks to a ControllerBase-style REST endpoint instead of a database directly. Create/Update/Store POST/PUT the model as JSON; Delete issues an HTTP DELETE by key. On a non-success response it deserializes the response body into a ValidationException so client code sees the same validation errors the server-side FluentValidation pipeline raised. Pair this with a matching ASP.NET Core controller that wraps a server-side XPDataStore/EFDataStore to get a full client↔server CRUD round-trip with one consistent validation error shape.

PredicateBuilder — composable LINQ expressions

public static class PredicateBuilder
{
    public static Expression<Func<T, bool>> True<T>();
    public static Expression<Func<T, bool>> False<T>();
    public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2);
    public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2);
}

Lets you build up a filter predicate incrementally (e.g. from a set of optional search filters) without hand-rolling expression-tree combination:

var predicate = PredicateBuilder.True<Customer>();
if (!string.IsNullOrEmpty(name))
    predicate = predicate.And(c => c.Name.Contains(name));
if (activeOnly)
    predicate = predicate.And(c => c.IsActive);

var results = store.Query().Where(predicate).ToList();

Notes

  • This package has no direct DevExpress dependency — it's the shared contract layer that both the XPO-backed and EF-Core-backed stores implement, so switching your data-access technology later doesn't require rewriting consumer code that only depends on IDataStore<TKey, TModel>.
  • [Obsolete] DataMapper<TKey, TModel, TDBModel> (DataMapper.cs) is kept for source compatibility only — use the AutoMapper- or Mapster-backed store variants instead.

See the root README for the full package list 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 net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on DX.Data:

Package Downloads
DX.Data.Xpo

Several XPO Related Helper classes and abstract DX.Data.IDataStore implementation for use with XPO with FluentValidation and no Mapping logic

DX.Data.EF

Abstract DX.Data.IDataStore implementation for use with EF with FluentValidation and no Mapping logic

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.1.3.36 481 7/31/2026
26.1.3.35 165 7/14/2026
25.2.3.34 454 4/7/2026
24.2.3.34 517 12/13/2024
24.1.6.34 477 9/25/2024
23.2.3.34 252 9/24/2024
23.2.3.33 441 9/17/2024
23.2.3.32 353 9/17/2024
23.2.3.31 550 1/11/2024

26.1.3.36: Added a README.md with technical documentation, now embedded in the package via PackageReadmeFile.
26.1.3.35: Rebuilt to align with the DXWeb v26.1.3 release wave (no DevExpress dependency in this package; version bumped for consistency across the repo).