using CH.CryptoStats.CoinMarketCap; using CH.Enum; using OpenHarbor.CQRS.Abstractions; namespace CH.CQRS.Query.CryptoStat; public class CryptoStatQuery { // public required string CoinName { get; set; } // public required string Currency { get; set; } } public class CryptoStatQueryHandler(CoinMarketCapService coinMarketCapService) : IQueryHandler { public async Task HandleAsync(CryptoStatQuery query, CancellationToken cancellationToken = new CancellationToken()) { var listCrypto = new List(); var cryptoStats = await coinMarketCapService.GetCryptoStatsAsync("bitcoin", "cad", cancellationToken); listCrypto.Add(cryptoStats); var listStat = new CryptoStatQueryResult { Data = listCrypto }; return listStat; } }