Lyo.Api.Models 1.0.7

dotnet add package Lyo.Api.Models --version 1.0.7
                    
NuGet\Install-Package Lyo.Api.Models -Version 1.0.7
                    
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.7" />
                    
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.7" />
                    
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.7
                    
#r "nuget: Lyo.Api.Models, 1.0.7"
                    
#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.7
                    
#: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.7
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Api.Models&version=1.0.7
                    
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 are fluent. Tests and gateways can skip object initializers.

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 and metadata

  • CrudMetadata. Success payload fragments (timestamps, concurrency tokens if the host sets them).
  • FileUpload / FileUploadRes. File pipeline results.
  • CacheItem (record + CacheItemTypeEnum Key / Tag). L1 snapshot rows from cache introspection: Name, Type, Created, Expires, plus Encrypted / Compressed / SizeBytes on keys. Helpers CacheItem.Key(name) / CacheItem.Tag(name) build instances. Equality / GetHashCode stay name+type so set membership ignores storage flags and timestamps.
  • Constants.ApiErrorCodes. Stable errors[].code strings on problem responses (Unknown, InvalidQuery, InvalidField, InvalidPaging, NotFound, Forbidden, Cancelled, SqlException, MessageQueueConnectionIssue, Conflict, ExceedMaxBulkSize, and the rest of the enum).

Errors and 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 and diagnostics

CacheItem and CacheItemTypeEnum describe this process's L1 cache introspection (not Redis L2). Payload keys can carry Encrypted, Compressed, SizeBytes, and Expires. QueryRequestScorer and QueryRequestScoreBreakdown feed explain endpoints for query planning. Pair them with scoring fields on ResultFactory outputs and server logs.

Relationship to Lyo.Result

Some server modules use Lyo.Result in process. ProblemDetails stay the wire contract.

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 send the same models through Lyo.Api.Client.

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)
  • Lyo.Result (transitive, 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.Discord.Models

Discord entity models and DTOs for the Lyo Discord integration.

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.Authentication.OpenIdConnect

OpenID Connect client base for Lyo.Authentication. Implements the BFF login flow used by Google and Keycloak adapters: OIDC discovery, JWKS cache, PKCE/state/nonce generation, /token exchange, id_token validation, and the external-login coordinator that maps an external login to a Lyo user + linked identity and mints a Lyo JWT.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 0 8/22/2026
1.0.6 163 8/20/2026
1.0.4 379 8/20/2026
1.0.3 366 8/19/2026
1.0.2 432 8/19/2026
1.0.1 566 8/18/2026
1.0.0 821 8/16/2026