Skip to content

.NET API Development Skill

Overview

The .NET API Development skill provides comprehensive guidance for building robust, scalable APIs using ASP.NET Core. This skill is designed to help developers create well-structured APIs following industry best practices and .NET conventions.

Key Features

  • Entity Framework Core Integration: Complete database context setup, migrations, and data access patterns
  • Repository & Unit of Work Patterns: Professional data access layer implementation
  • Controller Creation: Templates and patterns for building RESTful API controllers
  • CRUD Operations: Standard Create, Read, Update, Delete endpoint implementations with EF
  • Model Validation: Data annotation and FluentValidation patterns
  • Dependency Injection: Service registration and injection best practices
  • Authentication & Authorization: JWT-based security implementation
  • Error Handling: Comprehensive error handling and HTTP status code usage
  • API Versioning: Version management for API evolution
  • Testing: Unit and integration testing guidance with EF mocking

When to Use

This skill is particularly useful when:

  • Starting a new ASP.NET Core Web API project
  • Adding new controllers or endpoints to existing APIs
  • Implementing authentication and authorization
  • Setting up proper error handling and logging
  • Following .NET API development best practices
  • Writing tests for API endpoints

Skill Contents

The skill includes:

  • SKILL.md: Complete instructional guide with Entity Framework examples and best practices
  • README.md: Quick reference and usage guide

Examples Covered

  • Entity Framework Core database context configuration
  • Repository and Unit of Work pattern implementations
  • Basic CRUD controller implementation with EF queries
  • Service layer architecture with dependency injection
  • JWT authentication setup
  • API versioning configuration
  • Comprehensive error handling with EF exception management
  • Unit testing patterns with EF mocking
  • Database migrations and seeding

Best Practices Promoted

  • Async/await usage throughout
  • Proper HTTP status codes
  • RESTful API design principles
  • Dependency injection for testability
  • Comprehensive input validation
  • API documentation with Swagger/OpenAPI

Skill Location

This skill is available at: .github/skills/dotnet-api-development/

Version

Compatible with .NET 6+ and ASP.NET Core 6+