Lyo.Api.Models
2.0.0
dotnet add package Lyo.Api.Models --version 2.0.0
NuGet\Install-Package Lyo.Api.Models -Version 2.0.0
<PackageReference Include="Lyo.Api.Models" Version="2.0.0" />
<PackageVersion Include="Lyo.Api.Models" Version="2.0.0" />
<PackageReference Include="Lyo.Api.Models" />
paket add Lyo.Api.Models --version 2.0.0
#r "nuget: Lyo.Api.Models, 2.0.0"
#:package Lyo.Api.Models@2.0.0
#addin nuget:?package=Lyo.Api.Models&version=2.0.0
#tool nuget:?package=Lyo.Api.Models&version=2.0.0
Lyo.Api.Models
HTTP contract models shared by Lyo minimal APIs and their clients. Distinct from Lyo.Query.Models (projection DTOs + filter trees).
Features
ExportFormatExtensions(Enums/). MapsExportFormatonto the sharedFileTypeInfocatalog:FileType, andDefaultFileName(exportplus the format's default extension). Grids and endpoints read extension and MIME type from here instead of repeating per-format switches.
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. |
The builders are fluent, so tests and gateways do not need object initializers.
Response envelopes
Lyo.Api endpoints emit these concrete result records (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. |
CRUD service code should call ResultFactory.QuerySuccess / ProjectedQuerySuccess / CreateBulk / UpdateBulk / …` when building envelopes. Counts, query scores, and the success-versus-failure split are computed there.
Other models and metadata
CrudMetadata. Success payload fragments (timestamps, concurrency tokens if the host sets them).FileUpload/FileUploadRes. File pipeline results.CacheItem(record +CacheItemTypeEnumKey/Tag). L1 snapshot rows from cache introspection:Name,Type,Created,Expires, plusEncrypted/Compressed/SizeByteson keys. HelpersCacheItem.Key(name)/CacheItem.Tag(name)build instances. Equality /GetHashCodestay name+type so set membership ignores storage flags and timestamps.Constants.ApiErrorCodes. Stableerrors[].codestrings 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; 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 and diagnostics
This process's L1 cache (not Redis L2) is described by CacheItem and CacheItemTypeEnum. Payload keys may include Encrypted, Compressed, SizeBytes, and Expires. Explain endpoints for query planning consume QueryRequestScorer and QueryRequestScoreBreakdown. Those scores also appear on ResultFactory outputs and in server logs.
How this relates to Lyo.Result
In-process modules sometimes return Lyo.Result. On the wire the contract remains ProblemDetails.
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.Metadata(direct, lyo)Lyo.DateAndTime(direct, lyo)Lyo.Exceptions(direct, lyo)Lyo.Query.Models(direct, lyo)Lyo.Common.Core(transitive, lyo)Lyo.Common.Json(transitive, lyo)Lyo.Parameters(transitive, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)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.Metadata (>= 2.0.0)
- Lyo.DateAndTime (>= 2.0.0)
- Lyo.Exceptions (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
-
net10.0
- Lyo.Common.Metadata (>= 2.0.0)
- Lyo.DateAndTime (>= 2.0.0)
- Lyo.Exceptions (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
NuGet packages (15)
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.Api
Core API library for building RESTful APIs with Entity Framework Core, caching, and mapping support. |
|
|
Lyo.Job.Models
Job management models and DTOs for the Lyo API job management system. |
|
|
Lyo.Web.Components.Export
Composable data grid export UI for Lyo.Web.Components (JSON export and shared column selector). |
|
|
Lyo.Discord.Models
Discord entity models and DTOs for the Lyo Discord integration. |
GitHub repositories
This package is not used by any popular GitHub repositories.