Lyo.Api.Models
1.0.0
dotnet add package Lyo.Api.Models --version 1.0.0
NuGet\Install-Package Lyo.Api.Models -Version 1.0.0
<PackageReference Include="Lyo.Api.Models" Version="1.0.0" />
<PackageVersion Include="Lyo.Api.Models" Version="1.0.0" />
<PackageReference Include="Lyo.Api.Models" />
paket add Lyo.Api.Models --version 1.0.0
#r "nuget: Lyo.Api.Models, 1.0.0"
#:package Lyo.Api.Models@1.0.0
#addin nuget:?package=Lyo.Api.Models&version=1.0.0
#tool nuget:?package=Lyo.Api.Models&version=1.0.0
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 +CacheItemTypeEnumKey/Tag) — describes server cache entries surfaced by introspection endpoints; helpersCacheItem.Key(name)/CacheItem.Tag(name)build instances and the record’sGetHashCode/ToStringare stable for set membership.Constants.ApiErrorCodes— single source of truth for stableerrors[].codestrings 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; carriesDetail,Status,Timestamp,Errors(array ofApiError),Title,Type,Instance,TraceId,SpanId, optionalStacktrace, and bag-of-extensions. Helpers:MapErrorCodeToHttpStatus(code)( usesConstants.ApiErrorCodes),FromCode(errorCode, detail, …), andHttpStatusTitle(statusCode)(used by export wrapping).ApiError(record) — single entry inerrors[]:Code,Description, optionalStacktrace.ApiErrorException— sealedExceptioncarrying aLyoProblemDetails; 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 asInvalidPatchRequest).LFException(Error/LFException.cs) — domain-level Lyo exception carrying a stableErrorCode; hosts (e.g.Lyo.Api'sLoggingMiddleware) translate it into warning-levelLyoProblemDetails.LyoProblemDetailsBuilder— fluent builder for trace/span/route fields, message and error-code overrides, andAddApiError/FromExceptionshortcuts.
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.Clientto 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.Abstractions10.0.5— (transitive, microsoft)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)System.Text.Json10.0.5— (transitive, microsoft, netstandard2.0)
| Product | Versions 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. |
-
.NETStandard 2.0
- Lyo.Common (>= 1.0.0)
- Lyo.DateAndTime (>= 1.0.0)
- Lyo.Exceptions (>= 1.0.0)
- Lyo.Query.Models (>= 1.0.0)
-
net10.0
- Lyo.Common (>= 1.0.0)
- Lyo.DateAndTime (>= 1.0.0)
- Lyo.Exceptions (>= 1.0.0)
- Lyo.Query.Models (>= 1.0.0)
NuGet packages (13)
Showing the top 5 NuGet packages that depend on Lyo.Api.Models:
| Package | Downloads |
|---|---|
|
Lyo.Job.Models
Job management models and DTOs for the Lyo API job management system. |
|
|
Lyo.Api.Client
API client library for consuming Lyo APIs. |
|
|
Lyo.Reporting.Client
HTTP client for the Lyo Reporting API. |
|
|
Lyo.Web.Components.Export
Composable data grid export UI for Lyo.Web.Components (JSON export and shared column selector). |
|
|
Lyo.Job.Client
HTTP client for the Lyo Job API and IMqService-backed job event publisher for scheduler/worker hosts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 189 | 8/16/2026 |