Aspnet Core

ASP.NET Core cross-platform .NET framework with Blazor support. Use for C# web apps.

G1Joshi Updated

File contents

ASP.NET Core

Cross-platform, high-performance framework for building modern web apps.

When to Use

  • High-performance APIs (one of the fastest benchmarks)
  • Enterprise applications
  • Microservices
  • Real-time apps (SignalR)

Quick Start

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();

Core Concepts

Middleware Pipeline

Request processing pipeline composed of delegates.

Dependency Injection

Built-in DI container, a core citizen of the framework.

Kestrel

Cross-platform web server for ASP.NET Core.

Best Practices

Do:

  • Use the built-in DI
  • Use asynchronous controllers (async Task<IActionResult>)
  • Use Environment Variables for config settings

Don't:

  • Block asynchronous code (.Result or .Wait())
  • Store large objects in Session state

References

G1Joshi/Agent-Skills/tree/main/skills/frameworks/aspnet-core commit f3a0a35ed1

Frequently asked questions

npx skillmds@latest add g1joshi/aspnet-core