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
<PackageReference Include="General.Contracts.Shared" Version="1.0.1" />
<PackageVersion Include="General.Contracts.Shared" Version="1.0.1" />
<PackageReference Include="General.Contracts.Shared" />
paket add General.Contracts.Shared --version 1.0.1
#r "nuget: General.Contracts.Shared, 1.0.1"
#:package General.Contracts.Shared@1.0.1
#addin nuget:?package=General.Contracts.Shared&version=1.0.1
#tool nuget:?package=General.Contracts.Shared&version=1.0.1
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 | Versions 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. |
-
net10.0
- Polly (>= 8.7.0)
- System.Security.Cryptography.Xml (>= 10.0.11)
- System.ServiceModel.Http (>= 10.0.652802)
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.