dotnet-core

Guide ASP.NET Core application architecture with middleware, DI, and Options pattern.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/Objective-Arts/lens --skill dotnet-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-core
Source: https://github.com/Objective-Arts/lens/tree/main/canon/csharp/dotnet-core
Command: npx skills add https://github.com/Objective-Arts/lens --skill dotnet-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers build robust, scalable, and maintainable ASP.NET Core applications by adhering to established architectural patterns and avoiding common anti-patterns.

Core Features & Use Cases

  • Architectural Guidance: Provides best practices for Minimal APIs vs. Controllers, middleware pipeline configuration, and dependency injection.
  • Configuration & Options: Demonstrates effective use of the Options pattern for managing application settings.
  • Error Handling & Auth: Details robust error handling strategies using ProblemDetails and declarative authorization.
  • Use Case: A developer starting a new ASP.NET Core web API can use this Skill to ensure they are structuring their project correctly from the outset, setting up middleware, DI, and configuration in a way that promotes long-term maintainability and security.

Quick Start

Review the ASP.NET Core middleware pipeline best practices.

Frequently Asked Questions about dotnet-core

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

FAQPage Schema
What are the best practices for ASP.NET Core middleware pipeline ordering?

ASP.NET Core middleware pipeline ordering requires careful configuration to ensure secure and maintainable request processing. You must sequence components correctly to handle exceptions, authentication, and routing effectively before reaching your application core.

How do I choose between Minimal APIs and Controllers in ASP.NET Core?

Choosing between Minimal APIs and Controllers depends on your architectural needs for maintainable ASP.NET Core applications. Minimal APIs offer lightweight endpoints, while Controllers provide structured patterns for complex scenarios and declarative authorization.

How does dependency injection lifetimes work in ASP.NET Core?

Dependency injection lifetimes in ASP.NET Core manage service instantiation across scoped, transient, and singleton durations. Correct lifetime configuration prevents anti-patterns, ensures thread safety, and maintains scalable application state.

What is the best way to manage configuration in ASP.NET Core using the Options pattern?

The Options pattern manages ASP.NET Core configuration by binding strongly typed settings classes to your application configuration sources. This approach promotes long-term maintainability and secure settings access throughout your web API.

How do I implement robust error handling with ProblemDetails in ASP.NET Core?

ProblemDetails provides a standardized format for robust error handling in ASP.NET Core APIs. It delivers consistent HTTP API error responses, helping you avoid common anti-patterns and ensuring production-ready client communication.

Can I use declarative authentication and authorization in ASP.NET Core Minimal APIs?

Declarative authentication and authorization can be applied to ASP.NET Core Minimal APIs to secure endpoints. This architectural pattern ensures robust access control without coupling security logic directly into your business logic.