Lyo.Api.Models 1.0.1

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

Lyo.Api.Models

Shared HTTP contract models for Lyo minimal APIs and their clients—distinct from Lyo.Query.Models (filter trees + projection DTOs).

Request envelopes

Area Types (selected) Notes
Upsert / update / patch / delete UpsertRequest<T>, UpdateRequest<T>, PatchRequest, DeleteRequest, matching fluent *Builder classes Mirrors generic CRUD endpoints (server validates path + body alignment).
Exports ExportRequest, ExportColumnMapping Drive file generation endpoints.

Builders follow method-chaining ergonomics so gateways/tests avoid object initializer noise.

Response envelopes

Concrete result records emitted by Lyo.Api endpoints (see Common/Response/Result.cs and Common/Response/ResultFactory.cs). There is no generic ApiResponse<T> / BulkApiResponse<T> — each operation has its own typed envelope:

Envelope Returned by Notable fields
QueryRes<T> POST {route}/QueryConcrete IsSuccess, Items, Start, Amount, Total, HasMore, QueryScore, Error (echoes QueryRequest).
ProjectedQueryRes<T> POST {route}/QueryProject Adds EntityTypes (root + navigation/template CLR class names on success) and echoes the executed Select.
CreateResult<T> / CreateBulkResult<T> Create + Bulk create IsSuccess / Data / Error per row; bulk wraps CreatedCount / FailedCount.
UpdateResult<T> / UpdateBulkResult<T> Update + Bulk update Result enum (Updated/NoChange/Failed), Keys, OldData/NewData; bulk adds NoChangeCount.
PatchResult<T> / PatchBulkResult<T> Patch + Bulk patch Result enum, OldData/NewData, UpdatedProperties; IsSuccess derived from Updated/NoChange.
UpsertResult<T> / UpsertBulkResult<T> Upsert + Bulk upsert Result enum (Created/Updated/NoChange/Failed); bulk includes Created/Updated/NoChange/FailedCount.
DeleteResult<T> / DeleteBulkResult<T> Delete + Bulk delete IsSuccess, Data (deleted row), Error.

Use ResultFactory.QuerySuccess / ProjectedQuerySuccess / CreateBulk / UpdateBulk / …` to build envelopes from CRUD service code — they pre-compute counts, query scores, and split success vs failure paths.

Other models & metadata

  • CrudMetadata — standardized success payload fragments (timestamps, concurrency tokens if host sets them).
  • FileUpload / FileUploadRes — bridge file pipeline results.
  • CacheItem (record + CacheItemTypeEnum Key / Tag) — describes server cache entries surfaced by introspection endpoints; helpers CacheItem.Key(name) / CacheItem.Tag(name) build instances and the record’s GetHashCode / ToString are stable for set membership.
  • Constants.ApiErrorCodes — single source of truth for stable errors[].code strings on problem responses (Unknown, InvalidQuery, InvalidField, InvalidPaging, NotFound, Forbidden, Cancelled, SqlException, MessageQueueConnectionIssue, Conflict, ExceedMaxBulkSize, etc.). Check before duplicating literals in clients.

Errors & Problem Details

  • LyoProblemDetails (record) / ILyoProblemDetails — RFC 9457 problem details serialized with the default JSON contract; carries Detail, Status, Timestamp, Errors (array of ApiError), Title, Type, Instance, TraceId, SpanId, optional Stacktrace, and bag-of-extensions. Helpers: MapErrorCodeToHttpStatus(code) ( uses Constants.ApiErrorCodes), FromCode(errorCode, detail, …), and HttpStatusTitle(statusCode) (used by export wrapping).
  • ApiError (record) — single entry in errors[]: Code, Description, optional Stacktrace.
  • ApiErrorException — sealed Exception carrying a LyoProblemDetails; thrown when an operation fails with a structured problem (e.g. export over a failed projected query).
  • InvalidPropertyNameException — thrown when patch keys do not exist on the target type (surfaced as InvalidPatchRequest).
  • LFException (Error/LFException.cs) — domain-level Lyo exception carrying a stable ErrorCode; hosts (e.g. Lyo.Api's LoggingMiddleware) translate it into warning-level LyoProblemDetails.
  • LyoProblemDetailsBuilder — fluent builder for trace/span/route fields, message and error-code overrides, and AddApiError / FromException shortcuts.

Caching & diagnostics

CacheItem + CacheItemTypeEnum describe server cache introspection endpoints (used by internal tools & load tests). QueryRequestScorer, QueryRequestScoreBreakdown support explainability endpoints around query planning (pair with scoring fields on ResultFactory outputs + server logs).

Relationship to Lyo.Result

Some server modules choose Lyo.Result internally; ProblemDetails remain the wire representation while Lyo.Result informs * domain* logic in process boundaries.

Versioning guidance

  • Add [JsonPropertyName] compatibility shims during transition windows.
  • Document dual-read servers before removing legacy names.
  • Prefer additive optional properties over reinterpretation of existing ones.

Consumers

  • Minimal API hosts (Lyo.Api) reference these types directly in endpoint signatures.
  • Remote workers use the same models with Lyo.Api.Client to eliminate translation layers.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Common — (direct, lyo)
  • Lyo.DateAndTime — (direct, lyo)
  • Lyo.Exceptions — (direct, lyo)
  • Lyo.Query.Models — (direct, lyo)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 — (transitive, microsoft)
  • System.Memory 4.6.3 — (transitive, microsoft, netstandard2.0)
  • System.Text.Json 10.0.5 — (transitive, microsoft, netstandard2.0)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (13)

Showing the top 5 NuGet packages that depend on Lyo.Api.Models:

Package Downloads
Lyo.Api.Client

API client library for consuming Lyo APIs.

Lyo.Job.Models

Job management models and DTOs for the Lyo API job management system.

Lyo.Api

Core API library for building RESTful APIs with Entity Framework Core, caching, and mapping support.

Lyo.Web.Components.Export

Composable data grid export UI for Lyo.Web.Components (JSON export and shared column selector).

Lyo.Reporting.Client

HTTP client for the Lyo Reporting API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 0 8/18/2026
1.0.0 362 8/16/2026