General.Contracts.Shared 1.0.1

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

General.Contracts.Shared

Shared contracts and data models used by the Generic Backend and Generic API Client packages.

This package contains contracts only: generic interfaces, request/response models, pagination, and dynamic-filter definitions. It contains no database, HTTP, MVC, or UI implementations.

Architecture

                    General.Contracts.Shared
                    ─────────────────────────
                    Interfaces
                    Requests
                    Responses
                    Filters
                           │
              ┌────────────┴────────────┐
              ▼                         ▼
      Generic Backend            Generic API Client
              │                         │
              ▼                         ▼
           Web API                  Front UI

Main Contracts

Core

IGenericCore<TEntity, TResponse, TRequest>

Backend repositories

IGenericGetRepository<TEntity>
IGenericRepository<TEntity>

API repositories

IGenericGetAPIRepository<TResponse>
IGenericAPIRepository<TResponse, TRequest>

Shared Models

ResponseService<T>
QueryResult<T>
RequestPagination
QueryRequest
RequestDynamicFilter
FieldFilter
EnDataTypeField
EnFilterOperator
EnLogicalFilterOperator

Package Responsibilities

General.Contracts.Shared
    └── Defines what implementations must provide

Generic.Backend
    └── Implements server-side contracts

Generic.APIClient
    └── Implements client-side HTTP contracts

Contracts should remain independent of EF Core, ASP.NET Core MVC, Blazor, Razor, Scalar, and other infrastructure.

NuGet Consumption

The package may be consumed transitively through Generic.Backend or Generic.APIClient.

A Front application normally installs only the API Client package:

Front UI
   ↓
Generic.APIClient
   ↓
General.Contracts.Shared

A backend application normally installs only the Backend package:

Web API
   ↓
Generic.Backend
   ↓
General.Contracts.Shared

Direct installation of Contracts is appropriate when an application explicitly needs its public contracts.

Design Principles

  • Single source of truth for shared API contracts.
  • Dependency inversion through interfaces.
  • No infrastructure implementations.
  • Framework-light and safe for Blazor WebAssembly.
  • Clear separation between contracts and implementations.
  • Backward-compatible contract evolution where possible.
Product Compatible and additional computed target framework versions.
.NET 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. 
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 General.Contracts.Shared:

Package Downloads
General.Backend.Shared

Reusable .NET architecture components for ASP.NET Core and Entity Framework Core, providing generic repositories, Core services, CRUD operations, pagination, dynamic filtering, DTO mapping, HTTP QUERY support, generic controllers, and resilient HTTP communication.

General.Frontend.Shared

This package contains common elements for most FrontEnd projects with Blazor WebAssembly and Radzen. It includes a generic interface to implement the repository sponsor, an abstract class to implement it and 2 classes to handle generic grids.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 143 8/27/2026
1.0.0 110 8/27/2026