본문으로 건너뛰기
Skillpedia
일반 코딩40k · #7186

ef-core

하는 일

이 에이전트는 C#에서 데이터베이스를 다루는 도구인 Entity Framework Core용 코드를 더 좋고 효율적으로 작성하도록 돕습니다.

사용하는 경우

  • ✓Entity Framework Core를 쓰는 코드를 만들거나 수정할 때.
  • ✓코드가 빠르고 안전한지 확인하고 싶을 때.
  • ✓성능 문제나 데이터베이스 오류가 발생할 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/ef-core/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/ef-core/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“데이터베이스 지연을 피하도록 쿼리를 어떻게 최적화할 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

코드를 일련의 규칙과 모범 사례와 비교합니다. 개선할 수 있는 부분을 찾으면 그 방법을 제안합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Entity Framework Core Best Practices

Your goal is to help me follow best practices when working with Entity Framework Core.

Data Context Design

  • Keep DbContext classes focused and cohesive
  • Use constructor injection for configuration options
  • Override OnModelCreating for fluent API configuration
  • Separate entity configurations using IEntityTypeConfiguration
  • Consider using DbContextFactory pattern for console apps or tests

Entity Design

  • Use meaningful primary keys (consider natural vs surrogate keys)
  • Implement proper relationships (one-to-one, one-to-many, many-to-many)
  • Use data annotations or fluent API for constraints and validations
  • Implement appropriate navigational properties
  • Consider using owned entity types for value objects

Performance

  • Use AsNoTracking() for read-only queries
  • Implement pagination for large result sets with Skip() and Take()
  • Use Include() to eager load related entities when needed
  • Consider projection (Select) to retrieve only required fields
  • Use compiled queries for frequently executed queries
  • Avoid N+1 query problems by properly including related data

Migrations

  • Create small, focused migrations
  • Name migrations descriptively
  • Verify migration SQL scripts before applying to production
  • Consider using migration bundles for deployment
  • Add data seeding through migrations when appropriate

Querying

  • Use IQueryable judiciously and understand when queries execute
  • Prefer strongly-typed LINQ queries over raw SQL
  • Use appropriate query operators (Where, OrderBy, GroupBy)
  • Consider database functions for complex operations
  • Implement specifications pattern for reusable queries

Change Tracking & Saving

  • Use appropriate change tracking strategies
  • Batch your SaveChanges() calls
  • Implement concurrency control for multi-user scenarios
  • Consider using transactions for multiple operations
  • Use appropriate DbContext lifetimes (scoped for web apps)

Security

  • Avoid SQL injection by using parameterized queries
  • Implement appropriate data access permissions
  • Be careful with raw SQL queries
  • Consider data encryption for sensitive information
  • Use migrations to manage database user permissions

Testing

  • Use in-memory database provider for unit tests
  • Create separate testing contexts with SQLite for integration tests
  • Mock DbContext and DbSet for pure unit tests
  • Test migrations in isolated environments
  • Consider snapshot testing for model changes

When reviewing my EF Core code, identify issues and suggest improvements that follow these best practices.

자주 묻는 질문

Entity Framework Core가 무엇인가요?

C#으로 작성된 프로그램이 복잡한 SQL 명령을 직접 쓰지 않고도 데이터베이스와 쉽게 통신하도록 해 주는 도구입니다.

'모범 사례'란 무엇인가요?

어떤 일을 하는 잘 알려진 방법으로, 보통 더 빠르고, 더 안전하고, 유지보수하기 쉬운 코드를 만듭니다.

이것을 쓰려면 데이터베이스를 많이 알아야 하나요?

아니요. 에이전트는 Entity Framework Core가 처음이더라도 도움을 주도록 설계되었습니다.

상세 정보

작성자의 원본 설명

Get best practices for Entity Framework Core

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7186
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬