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
<PackageReference Include="Lyo.Api.Models" Version="1.0.7" />
<PackageVersion Include="Lyo.Api.Models" Version="1.0.7" />
<PackageReference Include="Lyo.Api.Models" />
paket add Lyo.Api.Models --version 1.0.7
#r "nuget: Lyo.Api.Models, 1.0.7"
#:package Lyo.Api.Models@1.0.7
#addin nuget:?package=Lyo.Api.Models&version=1.0.7
#tool nuget:?package=Lyo.Api.Models&version=1.0.7
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 +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
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.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.6)
- Lyo.DateAndTime (>= 1.0.6)
- Lyo.Exceptions (>= 1.0.6)
- Lyo.Query.Models (>= 1.0.6)
-
net10.0
- Lyo.Common (>= 1.0.6)
- Lyo.DateAndTime (>= 1.0.6)
- Lyo.Exceptions (>= 1.0.6)
- Lyo.Query.Models (>= 1.0.6)
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.