Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

ASP.NET Core docs
ASP.NET Core
Getting Started with ASP.NET CoreProject Structure and ConfigurationCore ConceptsData, Validation and AuthenticationTestingDeployment
Discussions

ASP.NET Core guide · 3/6

Core Concepts

ASP.NET Core is built from a few ideas that fit together: a host that runs the app, a middleware pipeline that every request passes through, a dependency injection container, endpoints written as minimal APIs or controllers, and configuration and logging shared by all of them.

Hosting and the middleware pipeline

WebApplication.CreateBuilder creates a host with Kestrel, configuration, logging and DI. After Build(), each Use... call adds a middleware component. A request flows through them in the order they were added; each can act before and after calling the next one, or end the request early.

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddProblemDetails();

var app = builder.Build();

app.UseExceptionHandler();      // first: catches errors from everything after it
app.UseHttpsRedirection();

app.Use(async (context, next) =>
{
    var watch = System.Diagnostics.Stopwatch.StartNew();
    await next(context);        // run the rest of the pipeline
    app.Logger.LogInformation("{Path} took {Ms} ms", context.Request.Path, watch.ElapsedMilliseconds);
});

app.UseAuthentication();
app.UseAuthorization();

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

Order matters: the exception handler comes first so it wraps everything, and authentication must run before authorization. Endpoints (Map...) run at the end of the pipeline.

Dependency injection

Services are registered on builder.Services with one of three lifetimes:

LifetimeOne instance perTypical use
AddSingletonapplicationcaches, clocks, stateless helpers
AddScopedHTTP requestDbContext, unit-of-work services
AddTransientresolutionlightweight stateless services
builder.Services.AddSingleton(TimeProvider.System);
builder.Services.AddScoped<TodoService>();

The framework injects services wherever it creates objects: minimal API handler parameters, controller constructors and other services. Do not inject a scoped service into a singleton; in Development the container detects this and throws.

Minimal APIs and controllers

Both styles share routing, DI and middleware. Minimal APIs map lambdas or methods directly. TypedResults and Results<...> make every possible response visible in the signature and in OpenAPI:

using Microsoft.AspNetCore.Http.HttpResults;

var todos = app.MapGroup("/todos");

todos.MapGet("/{id:int}", Results<Ok<Todo>, NotFound> (int id, TodoService service) =>
    service.Find(id) is { } todo ? TypedResults.Ok(todo) : TypedResults.NotFound());

todos.MapPost("/", (Todo todo, TodoService service) =>
{
    service.Add(todo);
    return TypedResults.Created($"/todos/{todo.Id}", todo);
});

Controllers group actions in classes and describe routes with attributes:

using Microsoft.AspNetCore.Mvc;

[ApiController]
[Route("api/[controller]")]
public class TodosController(TodoService service) : ControllerBase
{
    [HttpGet("{id:int}")]
    public ActionResult<Todo> Get(int id)
    {
        var todo = service.Find(id);
        if (todo is null) return NotFound();
        return todo;
    }
}

// Program.cs: builder.Services.AddControllers(); ... app.MapControllers();

Minimal APIs are the default for new APIs: less ceremony and very good performance. Controllers suit teams that like MVC conventions, filters and attribute-based model binding, and they are the basis of MVC apps with views.

Routing and binding

Route templates hold parameters and constraints such as {id:int}, {slug} and {page?}. Handler parameters are bound automatically: simple types from route values and the query string, complex types from the JSON body, registered services from DI, and special types such as HttpContext, HttpRequest and CancellationToken. Attributes like [FromQuery], [FromHeader] and [FromServices] (namespace Microsoft.AspNetCore.Mvc) make the source explicit.

// GET /posts/hello-world?page=2
app.MapGet("/posts/{slug}", (string slug, int? page, HttpRequest request) =>
    $"{slug}, page {page ?? 1}, agent {request.Headers.UserAgent}");

Configuration and options

Bind a configuration section to a class and inject it with the options pattern:

using Microsoft.Extensions.Options;

builder.Services.Configure<TodoOptions>(builder.Configuration.GetSection("Todo"));

app.MapGet("/settings", (IOptions<TodoOptions> options) => options.Value.PageSize);

public class TodoOptions
{
    public int PageSize { get; set; } = 20;
}

IOptionsSnapshot<T> re-reads values per request and IOptionsMonitor<T> reports changes. AddOptions<T>().BindConfiguration("Todo").ValidateDataAnnotations().ValidateOnStart() fails fast at startup when settings are invalid.

Logging

public class TodoService(ILogger<TodoService> logger)
{
    public void Add(Todo todo)
    {
        logger.LogInformation("Added todo {TodoId}", todo.Id);
    }
}

ILogger<T> is available everywhere through DI. Use message templates with named placeholders instead of string interpolation so providers can store TodoId as a structured field. Minimum levels per category come from the Logging:LogLevel configuration section.

Summary

  • Middleware runs in registration order; endpoints sit at the end of the pipeline.
  • DI has singleton, scoped and transient lifetimes; the framework injects services for you.
  • Minimal APIs and controllers are two styles on the same foundation.
  • Options classes give typed configuration, and ILogger<T> gives structured logs.
Questions about this chapter?
Previous chapterProject Structure and ConfigurationNext chapterData, Validation and Authentication

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.