dotnet/skills✦ 精选0°

create-datadriven-aspnetcore

仓库创建 2026年2月4日最近提交 2 小时前SkillHot 收录 1 天前
▸ 精选理由

可自动化添加符合项目风格的 CRUD/页面,节省重复样板代码工作。

▸ 风险提示

生成代码需审查以避免引入不兼容或不安全的实现

这个 Skill 做什么

基于项目约定生成或 scaffold ASP.NET Core 的控制器/页面/组件代码。

根据项目约定生成 ASP.NET Core 的控制器、Razor Page、Blazor 组件或 Minimal API 等代码,自动为模型类创建基于 EF Core/DbContext 的 CRUD 页面和端点。适合需要快速补齐表单、表格和导航、并且希望代码风格和现有 CSS 布局一致的场景。不依赖 CLI scaffolding,而是按项目惯例产出可直接使用的代码。

▸ 展开 SKILL.md 英文原文

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 CLI-based scaffolding is preferred.

开发编程ASP.NET代码生成CRUD通用
4.8k
Stars
350
Forks
40
仓库内 Skill
+639
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# 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
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有