public async IAsyncEnumerable <ApiStakingPower> ListPerformance( [Required, FromRoute] Symbol symbol, [FromQuery] ApiPerformanceQueryFilter queryFilter) { await foreach (var stakingPower in stakeService .ListStakePowersAsync(symbol, queryFilter.Mode, queryFilter.FromDate, queryFilter.ToDate, queryFilter.CurrencyCode) .WithCancellation(scopedCancellationToken.Token)) { yield return(MapStakingPower(stakingPower)); } }
public async IAsyncEnumerable <ApiPerformance> ListPerformance( [Required, FromRoute] Symbol symbol, [FromQuery] ApiPerformanceQueryFilter queryFilter) { await foreach (var perf in fundService .ListPerformanceAsync(symbol, queryFilter.Mode, queryFilter.FromDate, queryFilter.ToDate, queryFilter.CurrencyCode) .WithCancellation(scopedCancellationToken.Token)) { yield return(new ApiPerformance() { Date = perf.Date, NetAssetValuePerToken = perf.NetAssetValuePerToken, MarketCap = perf.MarketCap, MarketValuePerToken = perf.MarketAssetValuePerToken, Volume = perf.Volume }); } }