main
|
Last change
on this file since acf690c was 877c13c, checked in by kikisrbinoska <srbinoskakristina07@…>, 4 months ago |
|
Added files
|
-
Property mode
set to
100644
|
|
File size:
703 bytes
|
| Line | |
|---|
| 1 | using MediatR;
|
|---|
| 2 | using Microsoft.Extensions.Logging;
|
|---|
| 3 |
|
|---|
| 4 | namespace 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.