create-datadriven-aspnetcore
यह क्या करती है
यह स्किल डेटा मॉडल के लिए ASP.NET Core create, read, update और delete code लिखती है, जिसमें pages, views, components और API endpoints शामिल हैं। यह उन .NET डेवलपर के लिए है जिन्हें database पर आधारित डेटा स्क्रीन और APIs चाहिए।
कब इस्तेमाल करें
- ✓जब आप ASP.NET Core प्रोजेक्ट में किसी मॉडल के लिए create, edit, list और delete पेज चाहें।
- ✓जब आपको Entity Framework पर आधारित मॉडल के लिए API endpoints चाहिए।
- ✓जब आप अपने प्रोजेक्ट से मेल खाते Razor Pages, MVC views या Blazor components बनवाना चाहें।
Skill का लिंक
https://github.com/dotnet/skills/blob/main/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे ASP.NET Core प्रोजेक्ट में Product मॉडल के लिए CRUD पेज जोड़िए, मेरे मौजूदा layout और CSS का उपयोग करते हुए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट प्रोजेक्ट का layout, CSS framework और data context पढ़ता है, मौजूदा code से मेल खाते पेज या endpoints लिखता है, और build व migrations के लिए मानक 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
- 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
अक्सर पूछे जाने वाले सवाल
क्या यह scaffolding कमांड इस्तेमाल करती है?
नहीं। यह ASP.NET Core के scaffolding टूल के बजाय सीधे code लिखती है।
क्या यह मेरे प्रोजेक्ट की शैली से मेल खाती है?
हाँ। यह मौजूदा CSS framework, layout और coding पैटर्न से मेल खाती है।
क्या इसके लिए database चाहिए?
हाँ। बना हुआ code Entity Framework और database context पर आधारित है।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
create-custom-agent
5.8kयह आपके एजेंट को VS Code के custom agent फ़ाइलें बनाने देती है, जिनके अपने tools, निर्देश और दूसरे agents को handoffs होते हैं।
create-skill
5.8kयह आपके एजेंट को सही नाम, साफ़ trigger विवरण और मानक के अनुसार SKILL.md फ़ाइल वाली नई agent skill बनाने में मदद करती है।
csharp-scripts
5.8kयह आपके एजेंट को .NET command line टूल से एक छोटा C# प्रोग्राम एकल फ़ाइल के रूप में चलाने देती है, पूरा प्रोजेक्ट बनाए बिना।
dotnet-pinvoke
5.8kयह आपके एजेंट को .NET से native C या C++ libraries सही तरीके से कॉल करने में मदद करती है, जिसमें signatures, string संभालना, memory और सुरक्षित handles शामिल हैं।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।