dotnet-database

Configure EF Core 9 Fluent API mappings and migrations for SQL Server.

Updated Nov 30, 2025
One-click install
npx skills add https://github.com/gabrielsan90/FacturacionV2 --skill dotnet-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-database
Source: https://github.com/gabrielsan90/FacturacionV2/tree/main/.claude/skills/dotnet-database
Command: npx skills add https://github.com/gabrielsan90/FacturacionV2 --skill dotnet-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design and optimize the data layer for .NET applications using SQL Server and EF Core 9. This guide covers DataContext setup, Fluent API entity configuration, migrations, seed strategies, and best practices to avoid N+1 queries and unsafe deletions.

Core Features & Use Cases

  • Fluent API based entity configuration with proper indexing and relationships to ensure data integrity and performance.
  • Migration-first workflow (InitialCreate, incremental migrations) plus SeedDb integration for seeding roles and admin users.
  • Guidance to prevent N+1 queries, optimize common queries, and implement safe delete behavior across related entities.

Quick Start

Run the first EF Core migration to create your DataContext schema and seed initial data for a .NET 9 project.

Frequently Asked Questions about dotnet-database

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

FAQPage Schema
How do I configure EF Core 9 entities using Fluent API in a .NET 9 application?

Configure EF Core 9 entities using Fluent API by defining mappings within the DataContext to enforce indexing, relationships, and data integrity. This approach ensures proper data modeling and safe data access behavior across SQL Server backends.

What's the best way to prevent N+1 queries and unsafe deletions in EF Core 9?

Prevent N+1 queries and unsafe deletions in EF Core 9 by applying safe deletion policies across related entities and optimizing common queries. This ensures robust data access and prevents performance bottlenecks in your .NET application.

How do I create Code First migrations and seed initial data with EF Core 9?

Create Code First migrations and seed data with EF Core 9 by running an InitialCreate migration to generate the schema, then applying SeedDb integration to initialize roles and admin users for your .NET 9 project.

Does this data access layer guidance apply to SQL Server backends in .NET 9?

Yes, this data access layer guidance explicitly targets SQL Server backends in .NET 9. It applies to backend data modeling tasks such as designing the DataContext, configuring entities, and creating production-ready seed routines.

Why should I use Fluent API configurations instead of annotations for EF Core data modeling?

Use Fluent API configurations for EF Core data modeling because they provide greater control over entity mappings, proper indexing, and relationship configurations. This ensures data integrity and performance that data annotations cannot achieve.

When should I implement safe delete behavior across related entities in EF Core 9?

Implement safe delete behavior across related entities in EF Core 9 when configuring relationships to prevent unsafe deletions. This is necessary to maintain data integrity and avoid accidental data loss during backend data modeling tasks.