Last active
April 18, 2020 23:22
-
-
Save DavidRogersDev/c29df0b6e17adc85786e033e15e25e43 to your computer and use it in GitHub Desktop.
Gist for Medium Article - GetColorsQueryHandler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetColorsQueryHandler : IRequestHandler<GetColorsQuery, Either<IEnumerable<ColorPayloadDto>, ValidationResult>> | |
{ | |
private readonly IColorsService _colorsService; | |
public GetColorsQueryHandler(IColorsService colorsService) | |
{ | |
_colorsService = colorsService; | |
} | |
public async Task<Either<IEnumerable<ColorPayloadDto>, ValidationResult>> Handle(GetColorsQuery request, CancellationToken cancellationToken) | |
{ | |
return await _colorsService.GetColorsAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment