dotnet-controller-async

Convert synchronous ASP.NET Core controllers to async implementations with primary constructors.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/MauricioZwenger/ia-context --skill dotnet-controller-async
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-controller-async
Source: https://github.com/MauricioZwenger/ia-context/tree/main/skills/dotnet-controller-async
Command: npx skills add https://github.com/MauricioZwenger/ia-context --skill dotnet-controller-async

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of developing and refactoring ASP.NET Core controllers to fully embrace asynchronous programming, enhancing scalability and responsiveness.

Core Features & Use Cases

  • Create New Async Controllers: Scaffold controllers with primary constructors, async endpoints, and proper dependency injection for scalable web APIs.
  • Refactor Existing Synchronous Controllers: Convert sync action methods to async, propagate CancellationTokens, and optimize dependency calls.
  • Use Case: You have an existing ASP.NET Core API with synchronous controllers that need refactoring for better performance. This Skill automates that transition with minimal manual effort.

Quick Start

Use the dotnet-controller-async skill to refactor your existing controllers from synchronous to asynchronous methods, ensuring they follow best practices for C# 12+.

Frequently Asked Questions about dotnet-controller-async

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

FAQPage Schema
How do I refactor synchronous ASP.NET Core controllers to async methods?

Refactoring synchronous ASP.NET Core controllers to async involves converting action methods to asynchronous implementations, propagating CancellationTokens, and adapting dependencies to their async counterparts to improve API responsiveness and scalability.

What is the benefit of using async controllers in ASP.NET Core Web APIs?

The benefit of async controllers in ASP.NET Core is enhanced scalability and responsiveness, allowing the web API to handle more concurrent requests by freeing threads while awaiting operations rather than blocking them during synchronous execution.

Can I use primary constructors when creating new ASP.NET Core async controllers?

Yes, you can use primary constructors when creating new ASP.NET Core async controllers. This approach scaffolds controllers with proper dependency injection and async endpoints, following best practices for C# 12 and modern web API development.

Does this async controller refactoring approach work with C# 12?

Yes, this async controller refactoring approach works with C# 12. It ensures converted asynchronous implementations follow modern C# 12 best practices, including the use of primary constructors for cleaner dependency injection in ASP.NET Core APIs.

How do I propagate CancellationToken in refactored async ASP.NET Core controllers?

To propagate CancellationToken in async ASP.NET Core controllers, ensure it is properly passed through the asynchronous action methods and down to the adapted async dependencies, allowing cooperative cancellation during long-running API operations.

What are the limitations of converting sync controllers to fully async implementations?

Limitations of converting sync controllers to fully async implementations include the need to adapt all downstream dependencies to their async counterparts, which may require additional refactoring if existing libraries do not support asynchronous operations.