-
-
Save dcomartin/61db7ce0577a939ccdd3e8fa6761a900 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 record RegisterVehicle(string Vin); | |
| public class RegisterVehicleHandler | |
| { | |
| private readonly IVinDecoderService _vinDecoderService; | |
| public RegisterVehicleHandler(IVinDecoderService vinDecoderService) | |
| { | |
| _vinDecoderService = vinDecoderService; | |
| } | |
| public async Task<string> Handle(RegisterVehicle command, CancellationToken cancellationToken) | |
| { | |
| var vinResult = await _vinDecoderService.Lookup(command.Vin, cancellationToken); | |
| // Do something with the result... save in DB. Whatever. | |
| return $"{vinResult.Year} {vinResult.Make} {vinResult.Model}"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment