본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)5.8k · #14571

create-datadriven-aspnetcore

하는 일

이 스킬은 데이터 모델에 대해 생성, 조회, 수정, 삭제 코드를 ASP.NET Core로 작성합니다. 페이지, 뷰, 컴포넌트, API 엔드포인트가 포함됩니다. 데이터베이스에 연결된 데이터 화면과 API가 필요한 .NET 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓ASP.NET Core 프로젝트에서 모델의 생성, 수정, 목록, 삭제 페이지가 필요할 때.
  • ✓Entity Framework로 뒷받침되는 모델의 API 엔드포인트가 필요할 때.
  • ✓프로젝트에 맞는 Razor Pages, MVC 뷰, Blazor 컴포넌트를 만들고 싶을 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 ASP.NET Core 프로젝트에 기존 레이아웃과 CSS를 사용해 Product 모델의 생성, 수정, 목록, 삭제 페이지를 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 프로젝트의 레이아웃, CSS 프레임워크, 데이터 컨텍스트를 읽고, 기존 코드에 맞춰 페이지나 엔드포인트를 쓰며, 빌드와 마이그레이션에는 표준 dotnet 명령을 사용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

  1. Inspect the project file, Program.cs, target model, validation attributes, navigation properties, and foreign keys before editing.
  2. Reuse the requested existing DbContext; otherwise create the requested context. Add only the required provider package and register it with AddDbContext using the requested provider and connection string. You will need to add Microsoft.EntityFrameworkCore.Design (PrivateAssets="all") when migrations are needed and it's missing.
  3. Generate complete CRUD for the requested entity and every required parent entity: list, details, create, edit, and delete.
  4. Use the EF migration lifecycle: create a migration and apply it. Never call EnsureCreated or seed the database in Program.cs.
  5. Restore, build, and test the generated project. Fix errors before reporting completion.

MVC, Razor Pages, and Blazor

  1. Inspect the existing layout, CSS, and representative UI before generating markup.
  2. Generate the complete child and required-parent UI flows, including a navigation path to each resource so user
자주 묻는 질문

스캐폴딩 명령을 쓰나요?

아니요. ASP.NET Core 스캐폴딩 도구를 쓰지 않고 코드를 직접 작성합니다.

제 프로젝트 스타일에 맞추나요?

네. 기존 CSS 프레임워크, 레이아웃, 코딩 패턴에 맞춥니다.

데이터베이스가 필요한가요?

네. 생성된 코드는 Entity Framework와 데이터베이스 컨텍스트를 기반으로 합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14571
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬