GrumpTech.EntityWebApi.MinimalApi 0.1.2

Prefix Reserved
dotnet add package GrumpTech.EntityWebApi.MinimalApi --version 0.1.2
                    
NuGet\Install-Package GrumpTech.EntityWebApi.MinimalApi -Version 0.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GrumpTech.EntityWebApi.MinimalApi" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GrumpTech.EntityWebApi.MinimalApi" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="GrumpTech.EntityWebApi.MinimalApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GrumpTech.EntityWebApi.MinimalApi --version 0.1.2
                    
#r "nuget: GrumpTech.EntityWebApi.MinimalApi, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GrumpTech.EntityWebApi.MinimalApi@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GrumpTech.EntityWebApi.MinimalApi&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=GrumpTech.EntityWebApi.MinimalApi&version=0.1.2
                    
Install as a Cake Tool

EntityWebApi.MinimalApi

Part of EntityWebApi.

EntityWebApi.MinimalApi supports registering generic Minimal API handlers by resolving their generic type arguments during application startup. This allows you to expose a complete Minimal API for your Entity Framework Core entities based on a set of generic handlers.

Getting Started

Register services

Register the services required by EntityWebApi.MinimalApi and discover generic handlers in an assembly.

builder.Services.AddEntityMinimalApi(typeof(Program).Assembly);

Configure handlers

Configure how generic type arguments are resolved, then register handlers for your entity types.

app.UseEntityMinimalApi(options => options
    .SetDefaultArgumentResolver((argumentName, entityType) =>
        typeStore.GetRequired($"{entityType.Name}{argumentName[1..]}"))
    .AddArgumentResolver("TDbContext", _ => typeof(DataContext))
    .AddArgumentResolver("TEntity", entityType => entityType)
    .SetTagTemplate("Rest - [Entity]")
    .AddHandlers(typeof(GetAllHandler<,,>), entityTypes)
    .AddHandlers(typeof(GetHandler<,,,>), entityTypes)
    .AddHandlers(typeof(PostHandler<,,,>), entityTypes)
    .AddHandlers(typeof(PutHandler<,,,,>), entityTypes)
    .AddHandlers(typeof(PatchHandler<,,,,>), entityTypes)
    .AddHandlers(typeof(DeleteHandler<,,>), entityTypes)
);

This configuration:

  • Sets a default resolver for generic type arguments that do not have an explicitly registered resolver.
  • Registers a resolver for TDbContext that always resolves to DataContext.
  • Registers a resolver for TEntity that resolves to the current entity type.
  • Sets the OpenAPI/Swagger tag applied to generated endpoints. The placeholder [Entity] is replaced with the entity name.
  • Registers closed generic handlers for each type in entityTypes.

Registering handlers

Use AddHandlers to register a generic handler for multiple entity types.

options.AddHandlers(typeof(GetHandler<,,,>), entityTypes);

To register a generic handler for a single entity type, use AddHandler.

options.AddHandler(typeof(GetHandler<,,,>), typeof(Customer));
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.2 110 7/31/2026
0.1.1 103 7/20/2026
0.1.0 109 7/19/2026