ef-repository

Extends Entity Framework repository contracts and implementations with custom query methods.

23|10|Updated Aug 31, 2017
One-click install
npx skills add https://github.com/IntentArchitect/Intent.Modules --skill ef-repository-intentarchitect
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ef-repository
Source: https://github.com/IntentArchitect/Intent.Modules/tree/main/Tests/Accelerators/.agents/skills/ef-repository
Command: npx skills add https://github.com/IntentArchitect/Intent.Modules --skill ef-repository-intentarchitect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working with Entity Framework repositories in Intent Architect projects, developers often need to add custom query or persistence methods beyond the generated base methods. This Skill provides the rules and conventions for safely extending I*Repository.cs contracts and their Infrastructure implementations without breaking code generation or Intent Architect's managed code model. ## Core Features & Use Cases - Contract-First Extension: Enforces adding method signatures to the repository interface before implementing them in the concrete repository class. - Code Generation Safety: Specifies correct use of [IntentIgnore] and [IntentManaged] attributes so custom methods survive regeneration cycles. - Query Design Rules: Centralizes aggregations, joins, and filtering in the repository layer and forbids tuple returns in favor of Contract records. - Use Case: You need a complex aggregation query across multiple entities. Load this Skill, add the method signature to the repository interface, implement it in the Infrastructure repository with [IntentIgnore], and return a dedicated Contract record. ## Quick Start Load the ef-repository skill, then add a new aggregation query method to my Order repository interface and implement it in the Infrastructure repository class.

Frequently Asked Questions about ef-repository

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

FAQPage Schema
How do I add a custom method to an Entity Framework repository?▼

Add the method signature to the repository interface contract first, then implement it in the concrete repository class. Always read the base repository methods beforehand to avoid duplicating existing functionality.

How do I prevent Intent Architect from overwriting custom repository methods?▼

Add the [IntentIgnore] attribute to any custom method in the repository implementation. Do not put [IntentManaged] attributes, especially [IntentManaged(Mode.Fully)], on new interface methods.

Can repository methods return tuples in C#?▼

No, repository methods should never return tuples. If a complex return type is required, create a new Contract record in the Application layer, mark it with [IntentIgnore], and return that instead.

When should I add a new repository method versus using existing ones?▼

Only add new methods for querying aggregations or complex queries. For standard retrieval and persistence operations, use the existing base repository methods to keep the data access layer centralized and maintainable.

Where should aggregation and filtering logic live in an EF Core application?▼

Aggregations, joins, and filtering belong in the repository layer, not in services or other layers. Centralizing data access logic in repositories keeps it optimizable and maintainable.