Odex.AspNetCore.Clarc.Infrastructure 0.2.0

dotnet add package Odex.AspNetCore.Clarc.Infrastructure --version 0.2.0
                    
NuGet\Install-Package Odex.AspNetCore.Clarc.Infrastructure -Version 0.2.0
                    
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="Odex.AspNetCore.Clarc.Infrastructure" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Odex.AspNetCore.Clarc.Infrastructure" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Odex.AspNetCore.Clarc.Infrastructure" />
                    
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 Odex.AspNetCore.Clarc.Infrastructure --version 0.2.0
                    
#r "nuget: Odex.AspNetCore.Clarc.Infrastructure, 0.2.0"
                    
#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 Odex.AspNetCore.Clarc.Infrastructure@0.2.0
                    
#: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=Odex.AspNetCore.Clarc.Infrastructure&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Odex.AspNetCore.Clarc.Infrastructure&version=0.2.0
                    
Install as a Cake Tool

Odex.AspNetCore.Clarc.Infrastructure

NuGet NuGet Downloads CI Release License

Reusable infrastructure-layer helpers for .NET 9 that align with Odex.AspNetCore.Clarc.Domain: LINQ query builders, PagedRequest / PagedResponse<T> materialization, Specification<T> on IQueryable, a default ITransactionContext, and typed infrastructure exceptions. The public API is documented with XML comments. This assembly targets net9.0 and does not reference a specific ORM—you plug in Count, ToList, or async equivalents from your stack.


Table of contents


About

Odex.AspNetCore.Clarc.Infrastructure is part of the CLARC (clean-architecture style) family. It complements the Domain package with general-purpose building blocks you typically implement once per solution: composable IQueryable pipelines, pagination aligned with PagedRequest, PagedResponse<T> projection, specification-based filters, and a cooperative ITransactionContext for unit-of-work code.

The AspNetCore segment in the package ID is historical; the library does not require ASP.NET Core at compile time.


Installation

dotnet add package Odex.AspNetCore.Clarc.Infrastructure

Pin a version for reproducible builds:

dotnet add package Odex.AspNetCore.Clarc.Infrastructure --version 0.2.0

Requirements

Item Version
Target framework net9.0
Companion domain package Odex.AspNetCore.Clarc.Domain 0.2.x (referenced transitively when you add this package)
.NET SDK 9.x for development and CI

Runtime dependencies beyond .NET and Domain: none. The package build uses Microsoft.SourceLink.GitHub (private asset) for debuggable symbols on GitHub.


Clean architecture role

Layer Responsibility CLARC package
Domain Entities, value objects, specifications, repository interfaces, domain exceptions Odex.AspNetCore.Clarc.Domain
Application Use cases, orchestration Odex.AspNetCore.Clarc.Application (separate)
Infrastructure Persistence adapters, technical exceptions, query composition This package (plus your ORM-specific code in the host solution)

This library stays below application use-case code: it provides helpers, not business rules.


Capabilities

Area Summary
Query builders BaseQueryBuilder<TEntity,TIncludes>, PagedQueryBuilder<,> — fluent ModifyQuery, flags (IsFiltered, HasIncludes, HasSorts), ApplyPagination from PagedRequest.
Paged responses QueryablePagedResponseExtensionsToPagedResponse (sync LINQ); ToPagedResponseAsync with injected count/page delegates for async ORMs.
Specifications QueryableSpecificationExtensions.Where(query, specification) — uses Specification<T>.ToExpression().
Transactions TransactionContext — implements ITransactionContext; call NotifyCommitted / NotifyRolledBack from your IBaseRepository implementation.
Exceptions InfrastructureException and concrete types (ConfigurationException, RepositoryException, …) with Infrastructure.Constants.ExceptionType.

API documentation

Public types and members use /// XML documentation. GenerateDocumentationFile is enabled; the NuGet package ships Odex.AspNetCore.Clarc.Infrastructure.xml next to the assembly for IntelliSense and NuGet.org tooltips.


Quick examples

Paged response (sync, in-memory or deferred provider):

using Odex.AspNetCore.Clarc.Domain.ValueObjects.Requests;
using Odex.AspNetCore.Clarc.Infrastructure.Data.Pagination;

public sealed record MyListRequest : PagedRequest;

var page = myQuery.ToPagedResponse(new MyListRequest { Page = 2, PageSize = 10 });

Paged response (async — host supplies delegates; example uses EF Core extension methods after referencing that package):

var page = await myQuery.ToPagedResponseAsync(
    request,
    (q, ct) => q.CountAsync(ct),   // e.g. Microsoft.EntityFrameworkCore
    (q, ct) => q.ToListAsync(ct),
    cancellationToken);

Specification on IQueryable:

using Odex.AspNetCore.Clarc.Infrastructure.Data.Specifications;

var filtered = myQuery.Where(myDomainSpecification);

Transaction context (in your unit of work):

using Odex.AspNetCore.Clarc.Infrastructure.Contexts;

var ctx = new TransactionContext();
// Pass ctx into ExecuteInTransactionAsync; after store work:
ctx.NotifyCommitted(); // or ctx.NotifyRolledBack();

Namespaces

Namespace Contents
Odex.AspNetCore.Clarc.Infrastructure.Data.QueryBuilders BaseQueryBuilder, PagedQueryBuilder
Odex.AspNetCore.Clarc.Infrastructure.Data.Pagination QueryablePagedResponseExtensions
Odex.AspNetCore.Clarc.Infrastructure.Data.Specifications QueryableSpecificationExtensions
Odex.AspNetCore.Clarc.Infrastructure.Contexts TransactionContext
Odex.AspNetCore.Clarc.Infrastructure.Constants ExceptionType
Odex.AspNetCore.Clarc.Infrastructure.Exceptions Infrastructure exception types

Exception types (Domain vs Infrastructure)

  • Odex.AspNetCore.Clarc.Domain.Constants.ExceptionType — classifies domain failures (DomainException, policy violations, not found, concurrency, …).
  • Odex.AspNetCore.Clarc.Infrastructure.Constants.ExceptionType — classifies technical failures (configuration, DB connectivity, external HTTP, serialization, …).

Use the Domain enum at your application boundary for business errors; use the Infrastructure enum for infrastructure exceptions shipped from this package.


CI/CD

GitHub Actions run restore → strict Release build → tests → pack on every push and pull request to main, and a Release workflow publishes to NuGet.org from version tags or manual dispatch. See CONTRIBUTING.md for NUGET_API_KEY setup and tagging conventions.


Contributing

See CONTRIBUTING.md for local build commands, XML documentation rules, pull request expectations, and versioning.


Security

Report vulnerabilities privately per SECURITY.md. Do not use public issues for undisclosed security problems.


License

This project is released under the MIT License.


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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 85 5/14/2026
0.1.0 101 4/29/2026