source: ChapterX.Application/Status/Commands/UpdateHandler.cs@ b373fea

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

Added files

  • Property mode set to 100644
File size: 703 bytes
Line 
1using MediatR;
2using Microsoft.Extensions.Logging;
3
4namespace ChapterX.Application.Status.Commands
5{
6 // Status 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("Status 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.