Saltar al contenido principal
ProductosHerramientas de escritorioTASTECADRevisión de planosTASTEFILESGestión de archivosTASTEFTPTransferencia de archivosTASTESSHEspacio de trabajo remotoTASTEZIPCompresión y extracciónTASTEWINMGestión de archivosHerramientas para desarrolladoresTASTECODEEntorno de desarrollo integrado para RustTASTESTUDIOEntorno integrado de desarrollo y pruebasTASTEETLIntegración de datos (ETL)ServidoresTASTEREMOTEServidor de escritorio remotoTASTEGEOServidor geoespacialTASTEMAILEspacio de trabajo de correoInversiónTASTESTOCKAplicación de escritorio de trading automático de accionesEmpezarDescargasDocumentaciónComprarTodos los productos
Marketplace
Noticias
TecnologíaNoticiasNoticias de desarrollo de hoyDocumentaciónLenguajes de programaciónRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFrameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngularFrameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFrameworks de apps y escritorioTauriFlutterReact NativeElectronAlgoritmosFundamentos de algoritmosAlgoritmos esencialesAlgoritmos avanzadosAlgoritmos prácticos
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparateGuía de la comunidad
ColaboraTransferencia técnicaDesarrollo de sitio webDesarrollo de app de escritorioCanal de lanzamiento y pagosSocio de ventasContacto
ServiciosEscritorio remotoPaquetes de instalación a medida
TASTEDEV
Productos

Herramientas de escritorio

TASTECADAbre planos complejos con ligerezaTASTEFILESSolo los archivos que necesitas, lo más rápido posibleTASTEFTPEl camino más limpio para tus archivosTASTESSHEntre tu servidor y tú, una conexión más sólidaTASTEZIPComprime más rápido, descomprime más seguroTASTEWINMUn gestor de archivos de dos paneles pensado para el teclado

Herramientas para desarrolladores

TASTECODEEdita, compila, depura y prueba apps de Rust en una sola ventanaTASTESTUDIODe la edición a las pruebas remotas y las correcciones con IA aprobadasTASTEETLMueve datos viendo sus valores

Servidores

TASTEREMOTEUn escritorio remoto que funciona en tu propio servidorTASTEGEOUn servidor geoespacial compatible con GeoServer, reconstruido en RustTASTEMAILRecupera el control de tu correo

Inversión

TASTESTOCKTrading automático de acciones según las reglas que tú defines: cuándo y qué

Empezar

DescargasÚltimas versiones de cada productoDocsCómo usar cada productoComprarSuscripciones y licencias perpetuasTodos los productosTodos los productos de un vistazo
Todos los productos
MarketplaceNoticias
Tecnología

Noticias

Noticias de desarrollo de hoyAnuncios oficiales de lenguajes, frameworks, GitHub e IADocumentaciónGuías de lenguajes, frameworks y algoritmos

Lenguajes de programación

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Frameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngular
Frameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Frameworks de apps y escritorioTauriFlutterReact NativeElectron

Algoritmos

Fundamentos de algoritmosAnálisis de complejidad · Ordenamiento · Búsqueda · Estructuras de datos básicas · Árboles y montículosAlgoritmos esencialesRecorrido de grafos · Camino mínimo y árbol generador mínimo · Programación dinámica · Algoritmos voraces · Divide y vencerás · Backtracking (vuelta atrás)Algoritmos avanzadosAlgoritmos de cadenas · Matemáticas y teoría de números · Manipulación de bits · Árboles de segmentos · Union-FindAlgoritmos prácticosEstrategia para entrevistas de código · Caché LRU · Limitación de tasa · Hashing consistente
Toda la documentación de desarrollo
Comunidad
ProyectosDescubre creadores y su trabajoRegistros de desarrolloDecisiones y aprendizajesPromptsInstrucciones reutilizablesProblemas con herramientas de IAProblemas y alternativas de Claude, Codex, GeminiEscaparateResultados terminadosGuía de la comunidadCómo construimos en abierto
Colabora
Transferencia técnicaApps nativas con Rust y eguiDesarrollo de sitio web10 idiomas, cuentas, documentación y descargasDesarrollo de app de escritorioRust y egui, sin WebViewCanal de lanzamiento y pagosFirma, MSI, deb, rpm, AppImage, hashesSocio de ventasRecomiéndanos y gana el 30 %ContactoDesarrollo, alianzas e inversión
Servicios
Escritorio remotoAccede a tu ordenador desde el navegadorPaquetes de instalación a medidaSolo lo necesario, ajustes precargados
Comprar
ES
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Iniciar sesión
Iniciar sesión
TASTEDEV

De pequeñas herramientas a un mejor desarrollo.

support@tastedev.netApoyar a TASTEDEV
ProductosLínea de productosComprarDocsDescargasMarketplaceSoporte
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparate
PolíticasQuiénes somosPolítica de privacidadTérminos de servicioCondiciones de suscripciónReembolsosNormas de la comunidad
CuentaIniciar sesiónRegistrarse
Visitantes
Hoy
Ayer
Vistas totales
Empresa
GXSOFT
Representante
CHOI YOUNG GU
Número de registro mercantil
853-44-00368
Dirección
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Teléfono
+82-10-4404-1523
Correo electrónico
whitecalvin@tastedev.net
Responsable de privacidad
CHOI YOUNG GU

© 2026 TASTEDEVLa información de los productos se basa en fuentes de desarrollo verificadas.Publicado · en mejora

Documentación de ASP.NET Core
ASP.NET Core
Getting Started with ASP.NET CoreProject Structure and ConfigurationCore ConceptsData, Validation and AuthenticationTestingDeployment
Debates

Guía de ASP.NET Core · 3/6

Core Concepts

Por ahora, este capítulo solo está disponible en inglés.

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);
});
¿Tienes preguntas sobre este capítulo?
Capítulo anteriorProject Structure and ConfigurationCapítulo siguienteData, Validation and Authentication

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.

0 comentarios

Comentarios destacadosMás recientes primero

Iniciar sesión · Inicia sesión para dejar un comentario.