dotnet-scaffold-api-repo-controller

Scaffold ASP.NET Core API controllers delegating CRUD operations to repositories via GenericRepositoryApiController.

8|1|Updated Feb 5, 2018
One-click install
npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-scaffold-api-repo-controller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-scaffold-api-repo-controller
Source: https://github.com/umbrella-libraries/Umbrella/tree/main/.ai-shared/skills/dotnet-scaffold-api-repo-controller
Command: npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-scaffold-api-repo-controller

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffold ASP.NET Core API controllers that communicate directly with a repository via GenericRepositoryApiController, removing the need for a separate service layer and centralizing CRUD hooks on the controller itself.

Core Features & Use Cases

  • Scaffold a fully-functional API controller in Web<AppName>.Web.Server\Controllers\Api\ that delegates all CRUD operations to a repository through a GenericRepositoryApiController with 11 generic parameters.
  • Support NoOp/object endpoint disabling patterns to tailor which CRUD operations are exposed.
  • Provide lifecycle hooks such as AfterCreateEntityAsync, AfterUpdateEntityAsync, and AfterDeleteEntityAsync for project-specific customization.

Quick Start

Create the Manage<Name>Controller in your project to scaffold a full CRUD API controller using GenericRepositoryApiController.

Frequently Asked Questions about dotnet-scaffold-api-repo-controller

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold an ASP.NET Core API controller that connects directly to a repository?

To scaffold an ASP.NET Core API controller, this tool generates a controller inheriting from GenericRepositoryApiController, removing the need for a separate service layer by centralizing CRUD hooks directly on the controller itself.

What are repository lifecycle hooks in ASP.NET Core and how do I use them?

Repository lifecycle hooks are project-specific customization points for CRUD operations. This scaffolder provides AfterCreateEntityAsync, AfterUpdateEntityAsync, and AfterDeleteEntityAsync hooks directly within the generated API controller.

Can I disable specific CRUD operations in an ASP.NET Core API controller?

Yes, you can disable specific CRUD operations in an ASP.NET Core API controller using NoOp endpoint patterns. This scaffolder supports tailoring exposed operations by disabling individual object endpoints.

Do I need a separate service layer when using GenericRepositoryApiController?

No, you do not need a separate service layer. GenericRepositoryApiController communicates directly with the repository, allowing you to centralize all CRUD operation hooks within the API controller itself.

What generic parameters are required for ASP.NET Core repository controllers?

ASP.NET Core repository controllers require 11 generic parameters, adhering to the project's generics pattern from TSlimModel through TEntityKey, ensuring proper type safety and authorization conventions.