跳到正文
cccskills
免费在 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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(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(原文)

安装前可以查看交给 AI 代理的指令内容。

<!-- 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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

aspire

免费

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

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.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月19日 更新

查看 islamu-ngo 的全部技能

报告此技能的问题