create-datadriven-aspnetcore
Was er macht
Dieser Skill schreibt ASP.NET-Core-Code zum Anlegen, Lesen, Ändern und Löschen für ein Datenmodell, einschließlich Seiten, Views, Komponenten und API-Endpunkten. Er ist für .NET-Entwickler, die Datenmasken und APIs auf Basis einer Datenbank brauchen.
Wann du ihn nutzt
- ✓Wenn du Seiten zum Anlegen, Bearbeiten, Auflisten und Löschen für ein Modell in einem ASP.NET-Core-Projekt willst.
- ✓Wenn du API-Endpunkte für ein Modell auf Basis von Entity Framework willst.
- ✓Wenn du Razor Pages, MVC-Views oder Blazor-Komponenten passend zu deinem Projekt erzeugen willst.
Link zum Skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Füge CRUD-Seiten für das Modell Product in meinem ASP.NET-Core-Projekt hinzu und nutze mein bestehendes Layout und CSS.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent liest das Layout des Projekts, das CSS-Framework und den Datenkontext, schreibt die Seiten oder Endpunkte passend zum vorhandenen Code und nutzt Standard-dotnet-Befehle für Build und Migrationen.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Generate or Scaffold ASP.NET Core Code
Generate ASP.NET Core scaffolded code — controllers, views, Razor Pages, Blazor components, Minimal API endpoints. The generated code matches the project's existing CSS framework, layout conventions, and coding patterns. No CLI-based scaffolding/code-generation tools are used; standard dotnet CLI commands for build, restore, and migrations are still expected.
When to Use
- Adding CRUD pages, views, or components for a model in an ASP.NET Core project
- Scaffolding API controllers or Minimal API endpoints with Entity Framework Core
- Generating Razor Pages, MVC views, or Blazor components backed by a DbContext
When Not to Use
- The project is not an ASP.NET Core project
- You need to scaffold non-web artifacts (class libraries, console apps, etc.)
Inputs
| Input | Required | Description |
|---|---|---|
| Scaffolding request | Yes | Natural-language description of what to scaffold (see format below) |
| Project file path | Yes | Full path to the target .csproj file |
| Solution root path | Recommended | Path to the solution root for multi-project solutions |
Scaffolding Request Format
The scaffolding request should be a natural-language description of what to scaffold. The request must include the target project path and enough detail for the agent to generate the correct code. Examples:
Razor Pages with EF:
Scaffold Razor Pages with CRUD for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`.
Create a new DbContext `<DbContextName>` using <database-provider>.
Also scaffold CRUD for any entity that `<ModelName>` depends on via required foreign keys, so parent entities can be created first.
Blazor CRUD components:
Scaffold Blazor CRUD components for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`.
Create a new DbContext `<DbContextName>` using <database-provider>.
Minimal API endpoints:
Scaffold Minimal API endpoints for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`.
Name the endpoints class `<EndpointsClassName>`.
Create a new DbContext `<DbContextName>` using <database-provider>.
Enable OpenAPI support.
MVC Controller with views:
Scaffold an MVC controller with views and Entity Framework for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`.
Name the controller `<ControllerName>`.
Use existing DbContext `<DbContextName>`.
Generate views.
Empty items (no EF):
Scaffold an empty Razor Page named `<PageName>` in project `<path-to-csproj>`.
Workflow
Step 1: Understand the Scaffolding Request
Parse the scaffolding request to identify:
- Scaffolder type: Razor Pages, Blazor components, MVC controller, Minimal API, empty page/view/component
- Model class and its namespace
- DbContext: new or existing, database provider (SQLite, SQL Server, etc.)
- Named items: controller name, endpoints class name, page name, view name, area name
- Options: OpenAPI, async actions, partial view, custom layout
- FK scope: whether to also scaffold CRUD for parent entities referenced by required foreign keys
Execution Checklists
Complete the applicable checklist in order. Do not stop after creating only the requested child resource when a required foreign key makes a parent resource necessary.
All EF scaffolders
- Inspect the project file,
Program.cs, target model, validation attributes, navigation properties, and foreign keys before editing. - Reuse the requested existing
DbContext; otherwise create the requested context. Add only the required provider package and register it withAddDbContextusing the requested provider and connection string. You will need to add Microsoft.EntityFrameworkCore.Design (PrivateAssets="all") when migrations are needed and it's missing. - Generate complete CRUD for the requested entity and every required parent entity: list, details, create, edit, and delete.
- Use the EF migration lifecycle: create a migration and apply it. Never call
EnsureCreatedor seed the database inProgram.cs. - Restore, build, and test the generated project. Fix errors before reporting completion.
MVC, Razor Pages, and Blazor
- Inspect the existing layout, CSS, and representative UI before generating markup.
- Generate the complete child and required-parent UI flows, including a navigation path to each resource so user
Häufige Fragen
Nutzt er den Scaffolding-Befehl?
Nein. Er schreibt den Code direkt, statt die Scaffolding-Werkzeuge von ASP.NET Core zu nutzen.
Passt er sich meinem Projektstil an?
Ja. Er passt sich dem vorhandenen CSS-Framework, Layout und den Codierungsmustern an.
Braucht es eine Datenbank?
Ja. Der erzeugte Code basiert auf Entity Framework und einem Datenbankkontext.
Details
Originalbeschreibung des Autors
Generate or scaffold ASP.NET Core code — Razor Pages, Blazor components, MVC controllers, views, and Minimal API endpoints — without using ASP.NET Core CLI scaffolding/code-generation tools. Use when (1) adding CRUD pages, views, or API endpoints backed by Entity Framework (EF Core) and a database, (2) generating code to create, read, update, and delete data using a DbContext, (3) scaffolding UI components that match the project's existing CSS framework and coding patterns, or (4) creating data-driven forms, tables, and navigation for a model class. Do not use for non-ASP.NET projects or when
repo: dotnet/skills
Beliebtheit
- GitHub-Sterne
- 5.8k
- Platz im Ranking
- #14571
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
create-custom-agent
5.8kHilft deinem Agenten, Agenten-Dateien für VS Code zu erstellen, mit eigenen Werkzeugen, Anweisungen und Übergaben an andere Agenten.
create-skill
5.8kHilft deinem Agenten, einen neuen Agenten-Skill mit gültigem Namen, klarer Auslöserbeschreibung und einer SKILL.md-Datei nach dem Standard zu erstellen.
csharp-scripts
5.8kHilft deinem Agenten, ein kleines C#-Programm als einzelne Datei mit dem .NET-Kommandozeilen-Tool auszuführen, ohne ein vollständiges Projekt anzulegen.
dotnet-pinvoke
5.8kHilft deinem Agenten, native C- oder C++-Bibliotheken korrekt aus .NET aufzurufen, mit Signaturen, Zeichenkettenbehandlung, Speicher und sicheren Handles.
Ähnliche Skills
api-connector-builder
280kLässt deinen Agenten neue API-Anbindungen nach dem bestehenden Muster bauen. Nutze es, wenn du eine weitere Integration ergänzen willst, ohne neue Wege einzuführen.
api-design
280kHilft deinem Agenten, REST-APIs nach Best Practices zu entwerfen. Nützlich für die Kommunikation, die Fehlerausgabe und die Organisation von Daten.
backend-patterns
280kHilft deinem Agenten bei Architekturmustern für die Serverseite und bei der Datenbankoptimierung. Nützlich zum Bauen und Prüfen von Server-Code.