liuham.Presentation 1.4.6

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

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 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.
  • 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.

Version Downloads Last Updated
1.4.6 119 3/10/2026
1.4.5 99 3/10/2026
1.4.4 110 3/10/2026
1.4.3 115 3/10/2026
1.4.2 114 1/24/2026
1.4.1 116 1/24/2026