GrumpTech.EntityWebApi.Controllers 0.1.2

Prefix Reserved
dotnet add package GrumpTech.EntityWebApi.Controllers --version 0.1.2
                    
NuGet\Install-Package GrumpTech.EntityWebApi.Controllers -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.Controllers" 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.Controllers" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="GrumpTech.EntityWebApi.Controllers" />
                    
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.Controllers --version 0.1.2
                    
#r "nuget: GrumpTech.EntityWebApi.Controllers, 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.Controllers@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.Controllers&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=GrumpTech.EntityWebApi.Controllers&version=0.1.2
                    
Install as a Cake Tool

EntityWebApi.Controllers

Part of EntityWebApi.

EntityWebApi.Controllers supports registering generic ASP.NET Core controllers by resolving their generic type arguments at application startup. This makes it possible to expose a complete REST API for your Entity Framework Core entities using a single generic controller implementation.

Getting Started

Register services

Register the services of EntityWebApi.Controllers.

services.AddEntityWebApi();

Configure controllers

Configure how generic type arguments are resolved and register controllers for your entity types.

app.UseEntityWebApi(options => options
    .SetDefaultArgumentResolver((argumentName, entityType) =>
        typeStore.GetRequired($"{entityType.Name}{argumentName[1..]}"))
    .AddArgumentResolver("TDbContext", _ => typeof(DataContext))
    .AddArgumentResolver("TEntity", entityType => entityType)
    .AddControllers(typeof(RestController<,,,,,>), entityTypes)
);

This configuration:

  • Configures a default resolver for generic type arguments that do not have an explicit resolver.
  • Registers a resolver for TDbContext that always resolves to DataContext.
  • Registers a resolver for TEntity that resolves to the current entity type.
  • Registers a closed generic controller for each type in entityTypes.

Registering controllers

Use AddControllers to register a controller for multiple entity types.

options.AddControllers(typeof(RestController<,,,,,>), entityTypes);

Or use AddController to register a controller for a single entity type.

options.AddController(typeof(RestController<,,,,,>), 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 105 7/20/2026
0.1.0 109 7/19/2026