Exemple #1
0
        public async Task <AddToFavoritesResponse> AddToFavoritesAsync(AddToFavoritesRequest request, AddToFavoritesResponse response)
        {
            try
            {
                var newFavorite = await _weatherRepository.AddPlaceToFavorites(request.CityKey).ConfigureAwait(false);

                if (newFavorite != null)
                {
                    response.CityKey  = newFavorite.PlaceID;
                    response.CityName = newFavorite.PlaceName;
                    response.Success("AddToFavoritesAsync");
                }
            }
            catch (Exception ex) { response.Failed(ex); }
            return(response);
        }