GrumpTech.EntityWebApi.Core
0.1.2
Prefix Reserved
dotnet add package GrumpTech.EntityWebApi.Core --version 0.1.2
NuGet\Install-Package GrumpTech.EntityWebApi.Core -Version 0.1.2
<PackageReference Include="GrumpTech.EntityWebApi.Core" Version="0.1.2" />
<PackageVersion Include="GrumpTech.EntityWebApi.Core" Version="0.1.2" />
<PackageReference Include="GrumpTech.EntityWebApi.Core" />
paket add GrumpTech.EntityWebApi.Core --version 0.1.2
#r "nuget: GrumpTech.EntityWebApi.Core, 0.1.2"
#:package GrumpTech.EntityWebApi.Core@0.1.2
#addin nuget:?package=GrumpTech.EntityWebApi.Core&version=0.1.2
#tool nuget:?package=GrumpTech.EntityWebApi.Core&version=0.1.2
EntityWebApi.Core
Part of EntityWebApi.
This library contains a core object, attributes, and enums of EntityWebApi
Documentation
Documentation of EntityWebApi is available per package:
- EntityWebApi.AutoMapper
- EntityWebApi.Controllers
- EntityWebApi.Dtos
- EntityWebApi.EFCore
- EntityWebApi.MinimalApi
Getting started
TypeStore
TypeStore is a central registry for generated types. It stores and resolves DTOs, allowing EntityWebApi to locate the correct types when creating mappings or resolving generic type arguments.
DtoPropertyAttribute
DtoPropertyAttribute customizes how entity properties are represented in generated DTOs. It can be used to:
- Include or exclude a property from generation.
- Specify an alternative DTO for navigation properties.
- Make a property optional.
- Configure whether a property is read-only, write-only, or read/write.
Generic controllers
EntityWebApi uses generic controllers that are specialized at runtime for each entity. Route values can be generated from generic type arguments using the provided attributes.
[Route("[Entity]")]
[OpenApiTag("RestController - [Entity]")]
[ArgumentRouteValue("Entity", "TEntity")]
[ArgumentRouteValue("EntityKey", "TKeyDto", RouteValueConversion.ObjectValues)]
public class RestController<TDbContext, TEntity, TKeyDto, TDto, TPostDto, TPutDto, TPatchDto> : ControllerBase
Generic handlers
Minimal APIs can be built from generic handlers. The GenericHandler and GenericHandlerRoute attributes allow handlers to be discovered and mapped automatically for each entity.
[GenericHandler]
[ArgumentRouteValue("Entity", "TEntity")]
[ArgumentRouteValue("EntityKey", "TKeyDto", RouteValueConversion.ObjectValues)]
public class GetHandler<TDbContext, TEntity, TKeyDto, TDto>
where TDbContext : DbContext
where TEntity : class
where TKeyDto : class
{
[GenericHandlerRoute(HttpMethod.Get, "[Entity]/[EntityKey]")]
public async Task<TDto?> Handle([AsParameters] TKeyDto key)
| 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 (4)
Showing the top 4 NuGet packages that depend on GrumpTech.EntityWebApi.Core:
| Package | Downloads |
|---|---|
|
GrumpTech.EntityWebApi.AutoMapper
Generate and store Automapper mappers. |
|
|
GrumpTech.EntityWebApi.Controllers
Configure use of generic controllers. |
|
|
GrumpTech.EntityWebApi.MinimalApi
Configure use of endpoints. |
|
|
GrumpTech.EntityWebApi.Dtos
Generate DTOs from entities. |
GitHub repositories
This package is not used by any popular GitHub repositories.