/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/csharp/csharp-505-451-005/main.cs
16 строк
500 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
public class LoggingMiddleware { private readonly RequestDelegate _next; public LoggingMiddleware(RequestDelegate next) // только transient/singleton { _next = next; } public async Task InvokeAsync(HttpContext context) { var logger = context.RequestServices.GetRequiredService<ILogger<LoggingMiddleware>>(); logger.LogInformation("Request started"); await _next(context); } }