Skip to content
cccskills
FreePublished on GitHub

dotnet-efcore-guidelines

Load for EF Core entities/configurations, semantic value persistence, portable constraints, DbContext/query filters, repositories/specifications, migrations, model snapshots, transactions, or seeded lookup tables; use query-optimization specifically for N+1 or slow SQL diagnosis.

The English summary is being prepared. Showing the original description.

See how to install

Files included (7)

  • SKILL.md3.9 KB
  • resources/dbcontext-patterns.md403 B
  • resources/entity-configuration.md478 B
  • resources/migrations.md4.2 KB
  • resources/named-query-filters.md1.4 KB
  • resources/querying-patterns.md424 B
  • resources/repository-pattern.md423 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

<!-- ABOUTME: EF Core guidance for Explore.Persistence repositories, DbContext configuration, migrations, query filters, and PostgreSQL-aligned data access. --> <!-- ABOUTME: Keeps persistence entity-first, tenant-safe, soft-delete-aware, and consistent with lookup seeding and migration discipline. -->

Resources

  • Domain model — load for entity ownership and persisted invariants.
  • Record contracts — load for semantic value leaves, portable checks, generated-provider ownership, and migration preflight.
  • Architecture — load for repository and layer boundaries.
  • Codebase insights — load for non-obvious EF conventions.
  • Lookup seeder — load only for lookup-row changes.

Rules

  • Repositories return entities, never DTOs or IQueryable; read-only entity paths prefer AsNoTracking().
  • Named SoftDelete and Tenant filters remain active by default. Ignore only the exact filter required by the use case so tenant isolation cannot be disabled incidentally.
  • Domain entities and lifecycle rows remain classes. Persist selected semantic values through their existing scalar owner columns unless the model explicitly requires separate identity; do not introduce owned/complex entities or broad converters merely because the Domain API uses a record value.
  • Portable semantic constraints come from EF model/configuration or the repository migration generator. Verify provider SQL and malformed-row behavior instead of encoding one provider's syntax in shared configuration.
  • Migration and model-snapshot files are generated artifacts. Fix the model or generator, remove only an unapplied development migration through dotnet ef migrations remove, and regenerate every affected provider; applied migrations require a generated corrective migration.
  • For MariaDB/MySQL non-transactional constraint DDL, run a bounded PII-free preflight before installing a multi-constraint semantic set.
  • Pooled contexts tolerate absent scoped tenant/current-user services during migration and seeding.
  • Stable lookup IDs/codes stay aligned with idempotent missing-row repair. Insert migration-dependent lookup rows before backfill and keep model HasData() forbidden while EF Core #36682 applies.

Workflow

  1. Lock Domain semantics and provider-neutral malformed-row behavior with failing tests.
  2. Update entity/configuration or the migration generator; keep scalar column and wire ownership stable unless the task explicitly changes them.
  3. Generate each provider migration and inspect generated SQL/constraint ownership without hand edits.
  4. Run focused model/provider tests, real-engine lifecycle evidence where required, pending-model detection, and the owning build.

Verification

  • dotnet test --project tests/Event.Architecture.Tests/Event.Architecture.Tests.csproj --configuration Release --verbosity quiet -- --treenode-filter "/*/*/CleanArchitectureTests/*" --minimum-expected-tests 1 --no-progress --maximum-parallel-tests 1
  • dotnet test --project tests/Event.Persistence.IntegrationTests/Event.Persistence.IntegrationTests.csproj --configuration Release --verbosity quiet
  • dotnet build --configuration Release --verbosity quiet

Related

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Load for Blazor/MudBlazor UI changes involving forms, dialogs, focus, keyboard navigation, landmarks, ARIA, color contrast, RTL-safe styling, or WCAG 2.2 AA tests; not for backend-only changes.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

Load when a task asks to research, verify, compare, or look up framework/package behavior, release notes, standards, RFCs, CVEs, or unfamiliar APIs; use repository evidence first, then official docs, and not for codebase navigation alone.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

aspire

Free

Load for Aspire AppHost work: start/stop/wait resources, inspect dashboard/logs/traces, add integrations/resources, rebuild a service, run isolated worktrees, or diagnose Aspire orchestration; not for plain dotnet apps, container-only deployments, or cloud deployment.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

Load for authentication or authorization changes involving BFF cookies/tokens, JWT validation, claims/user ID extraction, policies, handler access checks, impersonation, or 401/403 bugs; not for UI affordance gating alone.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

Load for Blazor BFF server work involving YARP proxy routes, cookie sessions, access-token forwarding/refresh, downstream API calls, BFF handlers, or browser-to-API auth failures; not for client component rendering or API JWT validation alone.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

Load when editing Blazor `.razor.css`, scoped selectors, `::deep`, BEM class names, RTL/logical CSS properties, or styling nested MudBlazor components; not for global design tokens or non-Blazor CSS.

The English summary is being prepared. Showing the original description.

islamu-ngo/Event8Updated Oct 20, 2026

See all skills by islamu-ngo

Report a problem with this skill