LoomKit.Requests.Crud.Abstractions
10.0.1
dotnet add package LoomKit.Requests.Crud.Abstractions --version 10.0.1
NuGet\Install-Package LoomKit.Requests.Crud.Abstractions -Version 10.0.1
<PackageReference Include="LoomKit.Requests.Crud.Abstractions" Version="10.0.1" />
<PackageVersion Include="LoomKit.Requests.Crud.Abstractions" Version="10.0.1" />
<PackageReference Include="LoomKit.Requests.Crud.Abstractions" />
paket add LoomKit.Requests.Crud.Abstractions --version 10.0.1
#r "nuget: LoomKit.Requests.Crud.Abstractions, 10.0.1"
#:package LoomKit.Requests.Crud.Abstractions@10.0.1
#addin nuget:?package=LoomKit.Requests.Crud.Abstractions&version=10.0.1
#tool nuget:?package=LoomKit.Requests.Crud.Abstractions&version=10.0.1
LoomKit.Requests.Crud.Abstractions
Contracts for LoomKit.Requests.Crud: a single interface, IProjectable<TEntity, TDto>, that lets a DTO declare its own EF-Core-translatable projection expression.
Status: early stage. The public API may still change between versions — pin a commit/tag if you depend on it.
Why a separate package
IProjectable<TEntity, TDto> is implemented on your DTOs, not on your handlers. DTOs commonly live in a shared "contracts" project that is also referenced by client code (a Blazor WASM app, a mobile client, ...). That project has no business depending on LoomKit.Requests.Crud itself — the server-side CRUD handler base classes, LoomKit.Requests.Abstractions, LoomKit.Esits, and everything else that comes with it.
Referencing LoomKit.Requests.Crud.Abstractions alone gets you IProjectable with no further dependencies.
Installation
dotnet add package LoomKit.Requests.Crud.Abstractions
Usage
Implement IProjectable<TEntity, TDto> on a DTO to declare how it's built from its source entity:
using System.Linq.Expressions;
using LoomKit.Requests.Crud.Contracts;
public record ProductDto : IProjectable<Product, ProductDto>
{
public int Id { get; init; }
public string Name { get; init; }
public UserDto? User { get; init; }
// EF Core translates this into an optimized SQL SELECT.
// Use property-initializer syntax, not a positional record constructor.
public static Expression<Func<Product, ProductDto>> Projection =>
e => new ProductDto
{
Id = e.Id,
Name = e.Name,
User = new UserDto
{
Email = e.User.Email,
Roles = e.User.Roles.Select(r => new RoleDto
{
Id = r.Id,
Name = r.Name
}).ToList()
}
};
// Fields included by default when the caller doesn't request specific ones.
// Omit (or return []) to always include every field.
public static string[] DefaultSelects => ["Id", "Name"];
}
A server-side project using LoomKit.Requests.Crud's BaseGetByIdHandler/BaseListHandler reads Projection/DefaultSelects off the DTO to build a pruned, SQL-translatable query — see that package's README for the full Selects syntax and how the projection gets pruned at request time.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.1 | 147 | 8/25/2026 |