liuham.Presentation
1.4.6
dotnet add package liuham.Presentation --version 1.4.6
NuGet\Install-Package liuham.Presentation -Version 1.4.6
<PackageReference Include="liuham.Presentation" Version="1.4.6" />
<PackageVersion Include="liuham.Presentation" Version="1.4.6" />
<PackageReference Include="liuham.Presentation" />
paket add liuham.Presentation --version 1.4.6
#r "nuget: liuham.Presentation, 1.4.6"
#:package liuham.Presentation@1.4.6
#addin nuget:?package=liuham.Presentation&version=1.4.6
#tool nuget:?package=liuham.Presentation&version=1.4.6
liuham.Presentation
A lightweight, opinionated C#/.NET presentation-layer library for building consistent, secure, and extensible API responses and view models.
liuham.Presentation provides a small set of presentation abstractions, API response contracts, and cryptographic hooks that help standardize how data flows from your domain to your API consumers.
✨ Features
- Strongly-typed ViewModel & DataModel contracts
- Unified API response envelope
- Built-in support for response padding & encryption
- Clean separation between request models, response models, and transport metadata
- Designed for ASP.NET Core, but framework-agnostic
- Ideal for microservices, SDKs, and shared libraries
📦 Installation
dotnet add package liuham.Presentation
Or via NuGet Package Manager:
Install-Package liuham.Presentation
🧱 Core Concepts
1. Presentation Layer Abstractions
These interfaces and base classes help enforce consistency between your domain models and API-facing models.
Key Types
IDataModel
Marker interface for data objects intended for transport or transformation.IDataViewModel
Contract for presentation-friendly models exposed to consumers.DataViewModelCollection<T>
A structured collection for returning lists of view models with metadata.DataViewModelException
A presentation-layer exception for controlled API error handling.
2. API Namespace
The API namespace contains standardized request and response contracts suitable for public-facing APIs.
🌐 API Components
Response Models
| Type | Description |
|---|---|
ApiResponse<T> |
Generic response wrapper for all API responses |
ResponseModel |
Base response payload |
ResponseMessage |
Human-readable message container |
ResponseHeader |
Response metadata (status, timestamps, etc.) |
ResponseStatus |
Enum representing response state |
ResponsePadding |
Optional response obfuscation/padding |
Request Models
| Type | Description |
|---|---|
IRequestModel |
Contract for all API request models |
RequestModel |
Base implementation of IRequestModel |
Messaging Contracts
| Type | Description |
|---|---|
IResponseModel |
Contract for API response payloads |
IResponseMessage |
Contract for response messages |
Security & Cryptography
| Type | Description |
|---|---|
ApiEncryptionType |
Supported encryption modes |
IApiCryptographicService |
Interface for pluggable encryption/decryption |
This design allows you to inject custom cryptographic providers without coupling your application to a specific implementation.
| 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.