{"id":"73acd114-a0fe-499b-ae59-0839a5d2103b","shortId":"d9EAvt","kind":"skill","title":"ef-core","tagline":"Get best practices for Entity Framework Core","description":"# Entity Framework Core Best Practices\n\nYour goal is to help me follow best practices when working with Entity Framework Core.\n\n## Data Context Design\n\n- Keep DbContext classes focused and cohesive\n- Use constructor injection for configuration options\n- Override OnModelCreating for fluent API configuration\n- Separate entity configurations using IEntityTypeConfiguration\n- Consider using DbContextFactory pattern for console apps or tests\n\n## Entity Design\n\n- Use meaningful primary keys (consider natural vs surrogate keys)\n- Implement proper relationships (one-to-one, one-to-many, many-to-many)\n- Use data annotations or fluent API for constraints and validations\n- Implement appropriate navigational properties\n- Consider using owned entity types for value objects\n\n## Performance\n\n- Use AsNoTracking() for read-only queries\n- Implement pagination for large result sets with Skip() and Take()\n- Use Include() to eager load related entities when needed\n- Consider projection (Select) to retrieve only required fields\n- Use compiled queries for frequently executed queries\n- Avoid N+1 query problems by properly including related data\n\n## Migrations\n\n- Create small, focused migrations\n- Name migrations descriptively\n- Verify migration SQL scripts before applying to production\n- Consider using migration bundles for deployment\n- Add data seeding through migrations when appropriate\n\n## Querying\n\n- Use IQueryable judiciously and understand when queries execute\n- Prefer strongly-typed LINQ queries over raw SQL\n- Use appropriate query operators (Where, OrderBy, GroupBy)\n- Consider database functions for complex operations\n- Implement specifications pattern for reusable queries\n\n## Change Tracking & Saving\n\n- Use appropriate change tracking strategies\n- Batch your SaveChanges() calls\n- Implement concurrency control for multi-user scenarios\n- Consider using transactions for multiple operations\n- Use appropriate DbContext lifetimes (scoped for web apps)\n\n## Security\n\n- Avoid SQL injection by using parameterized queries\n- Implement appropriate data access permissions\n- Be careful with raw SQL queries\n- Consider data encryption for sensitive information\n- Use migrations to manage database user permissions\n\n## Testing\n\n- Use in-memory database provider for unit tests\n- Create separate testing contexts with SQLite for integration tests\n- Mock DbContext and DbSet for pure unit tests\n- Test migrations in isolated environments\n- Consider snapshot testing for model changes\n\nWhen reviewing my EF Core code, identify issues and suggest improvements that follow these best practices.","tags":["core","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-ef-core","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/ef-core","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (2,593 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:10.608Z","embedding":null,"createdAt":"2026-04-18T20:25:50.627Z","updatedAt":"2026-05-18T18:52:10.608Z","lastSeenAt":"2026-05-18T18:52:10.608Z","tsv":"'+1':158 'access':277 'add':188 'annot':94 'api':50,97 'app':63,265 'appli':179 'appropri':103,194,214,236,259,275 'asnotrack':116 'avoid':156,267 'batch':240 'best':5,14,23,350 'bundl':185 'call':243 'care':280 'chang':232,237,335 'class':36 'code':341 'cohes':39 'compil':150 'complex':224 'concurr':245 'configur':44,51,54 'consid':57,72,106,141,182,220,252,285,330 'consol':62 'constraint':99 'constructor':41 'context':32,311 'control':246 'core':3,10,13,30,340 'creat':167,308 'data':31,93,165,189,276,286 'databas':221,295,303 'dbcontext':35,260,318 'dbcontextfactori':59 'dbset':320 'deploy':187 'descript':173 'design':33,67 'eager':135 'ef':2,339 'ef-cor':1 'encrypt':287 'entiti':8,11,28,53,66,109,138 'environ':329 'execut':154,203 'field':148 'fluent':49,96 'focus':37,169 'follow':22,348 'framework':9,12,29 'frequent':153 'function':222 'get':4 'goal':17 'groupbi':219 'help':20 'identifi':342 'ientitytypeconfigur':56 'implement':77,102,122,226,244,274 'improv':346 'in-memori':300 'includ':133,163 'inform':290 'inject':42,269 'integr':315 'iquery':197 'isol':328 'issu':343 'judici':198 'keep':34 'key':71,76 'larg':125 'lifetim':261 'linq':208 'load':136 'manag':294 'mani':87,89,91 'many-to-mani':88 'meaning':69 'memori':302 'migrat':166,170,172,175,184,192,292,326 'mock':317 'model':334 'multi':249 'multi-us':248 'multipl':256 'n':157 'name':171 'natur':73 'navig':104 'need':140 'object':113 'one':81,83,85 'one-to-mani':84 'one-to-on':80 'onmodelcr':47 'oper':216,225,257 'option':45 'orderbi':218 'overrid':46 'own':108 'pagin':123 'parameter':272 'pattern':60,228 'perform':114 'permiss':278,297 'practic':6,15,24,351 'prefer':204 'primari':70 'problem':160 'product':181 'project':142 'proper':78,162 'properti':105 'provid':304 'pure':322 'queri':121,151,155,159,195,202,209,215,231,273,284 'raw':211,282 'read':119 'read-on':118 'relat':137,164 'relationship':79 'requir':147 'result':126 'retriev':145 'reusabl':230 'review':337 'save':234 'savechang':242 'scenario':251 'scope':262 'script':177 'secur':266 'seed':190 'select':143 'sensit':289 'separ':52,309 'set':127 'skill' 'skill-ef-core' 'skip':129 'small':168 'snapshot':331 'source-github' 'specif':227 'sql':176,212,268,283 'sqlite':313 'strategi':239 'strong':206 'strongly-typ':205 'suggest':345 'surrog':75 'take':131 'test':65,298,307,310,316,324,325,332 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'track':233,238 'transact':254 'type':110,207 'understand':200 'unit':306,323 'use':40,55,58,68,92,107,115,132,149,183,196,213,235,253,258,271,291,299 'user':250,296 'valid':101 'valu':112 'verifi':174 'vs':74 'web':264 'work':26","prices":[{"id":"3c12cd25-541d-4995-82a0-bd3cf4f07c3b","listingId":"73acd114-a0fe-499b-ae59-0839a5d2103b","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:50.627Z"}],"sources":[{"listingId":"73acd114-a0fe-499b-ae59-0839a5d2103b","source":"github","sourceId":"github/awesome-copilot/ef-core","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/ef-core","isPrimary":false,"firstSeenAt":"2026-04-18T21:49:15.571Z","lastSeenAt":"2026-05-18T18:52:10.608Z"},{"listingId":"73acd114-a0fe-499b-ae59-0839a5d2103b","source":"skills_sh","sourceId":"github/awesome-copilot/ef-core","sourceUrl":"https://skills.sh/github/awesome-copilot/ef-core","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:50.627Z","lastSeenAt":"2026-05-07T22:40:18.088Z"}],"details":{"listingId":"73acd114-a0fe-499b-ae59-0839a5d2103b","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"ef-core","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"eea8ee4784af975f4e754f92dc19234e3e68cc5d","skill_md_path":"skills/ef-core/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/ef-core"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"ef-core","description":"Get best practices for Entity Framework Core"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/ef-core"},"updatedAt":"2026-05-18T18:52:10.608Z"}}