CryptoMarkets.cs 539 B

12345678910111213141516171819202122
  1. using MediatR;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Crypto;
  4. internal sealed class CryptoMarkets : IEndpoint
  5. {
  6. public void MapEndpoint(IEndpointRouteBuilder app)
  7. {
  8. app.MapGet("api/crypto/markets", async (
  9. ISender sender,
  10. CancellationToken ct
  11. ) =>
  12. {
  13. return ApiResponse.Ok(
  14. await sender.Send(new Application.Features.Api.Crypto.Market.GetAll.Query(), ct)
  15. );
  16. })
  17. .WithTags("Crypto")
  18. .AllowAnonymous();
  19. }
  20. }