Ejemplo n.º 1
0
        public async Task <List <SelectOptionDto <int> > > GetRocketsForSelection()
        {
            try
            {
                var response = await _httpClient.GetAsync("api/Rockets/ForSelection");

                return(await _serviceResponseHandler.HandleJsonResponse <List <RocketLaunchJournal.Infrastructure.Dtos.Helpers.SelectOptionDto <int> > >(response));
            }
            catch (AccessTokenNotAvailableException exception)
            {
                exception.Redirect();
            }
            return(new List <SelectOptionDto <int> >());
        }
Ejemplo n.º 2
0
        public async Task <List <RocketDto> > GetRockets()
        {
            try
            {
                var response = await _httpClient.GetAsync("api/Rockets");

                return(await _serviceResponseHandler.HandleJsonResponse <List <RocketDto> >(response));
            }
            catch (AccessTokenNotAvailableException exception)
            {
                exception.Redirect();
            }

            return(new List <RocketDto>());
        }