Exemple #1
0
        public async Task <IActionResult> GetForTypeAsync([Required][FromRoute] string type)
        {
            var explorers = await _blockchainExplorersServiceCached.GetAsync(type);

            if (explorers == null || !explorers.Any())
            {
                return(NoContent());
            }

            var response = new BlockchainExplorersCollectionResponse()
            {
                Collection = explorers.Select(MapToResponse)
            };

            return(Ok(response));
        }
Exemple #2
0
        public async Task <IActionResult> GetAllAsync()
        {
            var settings = await _blockchainExplorersServiceCached.GetAllAsync();

            if (settings == null || !settings.Any())
            {
                return(NoContent());
            }

            var response = new BlockchainExplorersCollectionResponse()
            {
                Collection = settings.Select(MapToResponse),
            };

            return(Ok(response));
        }