csharp-developer

Implements C# applications with .NET 8, ASP.NET Core APIs, Blazor, and Entity Framework Core.

Updated Aug 10, 2025
One-click install
npx skills add https://github.com/afonsoft/ai-studio-workspace --skill csharp-developer-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: csharp-developer
Source: https://github.com/afonsoft/ai-studio-workspace/tree/main/agents/skills/csharp-developer
Command: npx skills add https://github.com/afonsoft/ai-studio-workspace --skill csharp-developer-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building modern .NET applications requires consistent application of C# 12 language features, ASP.NET Core patterns, EF Core data access, and performance optimization techniques, which are easy to get wrong without senior-level guidance. ## Core Features & Use Cases - ASP.NET Core API Development: Build Minimal APIs and controller-based endpoints with route groups, endpoint filters, JWT authentication, rate limiting, and output caching. - Entity Framework Core Data Access: Implement DbContext configurations, repository patterns, query optimization with AsNoTracking and compiled queries, migrations, and bulk operations. - Blazor & Performance: Create Blazor components with state management and JS interop, plus optimize code using Span<T>, ArrayPool, ValueTask, and BenchmarkDotNet. - Use Case: When asked to build a product catalog API, the skill produces domain models, Minimal API endpoints with validation filters, an EF Core repository with pagination, and xUnit tests following clean architecture. ## Quick Start Ask the assistant to build an ASP.NET Core Minimal API with Entity Framework Core for managing products, including JWT authentication and unit tests.

Frequently Asked Questions about csharp-developer

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

FAQPage Schema
How do I build a Minimal API in ASP.NET Core with .NET 8?▼

Define endpoints using route groups with MapGroup, then map GET, POST, PUT, and DELETE handlers that return typed Results. Add endpoint filters for validation, register services with dependency injection, and configure JWT bearer authentication in Program.cs.

How to optimize Entity Framework Core query performance?▼

Use AsNoTracking for read-only queries, project into DTOs with Select instead of loading full entities, and apply AsSplitQuery to avoid cartesian explosion on includes. For repeated queries, use EF.CompileAsyncQuery, and use ExecuteUpdateAsync or ExecuteDeleteAsync for bulk operations.

Does Blazor support JavaScript interop for third-party libraries?▼

Yes, Blazor supports JS interop through IJSRuntime by importing ES modules with InvokeAsync and calling exported functions. Initialize modules in OnAfterRenderAsync on first render and dispose IJSObjectReference instances via IAsyncDisposable to avoid leaks.

Should I use Task or ValueTask for async methods in C#?▼

Use ValueTask when a method frequently completes synchronously, such as cache hits, to avoid Task allocation. Use Task for methods that are almost always asynchronous, and always accept a CancellationToken for cancellable operations.

When should I avoid exposing EF Core entities in API responses?▼

Never expose EF Core entities directly in API responses because they leak database schema details, risk over-posting attacks, and can cause serialization cycles with navigation properties. Map entities to DTOs using Select projections instead.