source: ChapterX.Application/Roles/Commands/UpdateHandler.cs

main
Last change on this file was 877c13c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago

Added files

  • Property mode set to 100644
File size: 700 bytes
Line 
1using MediatR;
2using Microsoft.Extensions.Logging;
3
4namespace ChapterX.Application.Roles.Commands
5{
6 // Roles is an enum — values cannot be updated at runtime.
7 public class UpdateHandler : IRequestHandler<UpdateRequest, UpdateResponse>
8 {
9 private readonly ILogger<UpdateHandler> _logger;
10
11 public UpdateHandler(ILogger<UpdateHandler> logger)
12 {
13 _logger = logger;
14 }
15
16 public Task<UpdateResponse> Handle(UpdateRequest request, CancellationToken cancellationToken)
17 {
18 _logger.LogWarning("Roles is an enum and cannot be updated at runtime.");
19 return Task.FromResult(new UpdateResponse(false));
20 }
21 }
22}
Note: See TracBrowser for help on using the repository browser.