/
urmat
/
taskboardproject1
Обзор
Документация
Войти
/
urmat
/
taskboardproject1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
UserService
src/UserService.Business/Application/Events/LogEventHandler.cs
21 строка
641 B
urmatgit
add Publisher (INotificaton), save to log
08 апр 2025, 14:09
08 апр 2025, 14:09
1c69071
Код
Авторство
О чём код?
using MediatR; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UserService.Business.Application.Events { //пишем лог через INotificationHandler public class LogEventHandler(ILogger<LogEventHandler> _logger) : INotificationHandler<EntityEvent> { public Task Handle(EntityEvent notification, CancellationToken cancellationToken) { _logger.LogInformation($"{notification.message}. ({notification.baseEntity.Id})"); return Task.CompletedTask; } } }