public async Task <DeleteFavoriteResponse> DeleteFavoriteAsync(DeleteFavoriteRequest request, DeleteFavoriteResponse response) { try { var isSuccess = await _weatherRepository.DeleteFromFavorites(request.CityKey).ConfigureAwait(false); if (isSuccess) { response.Success("DeleteFavoriteAsync"); } } catch (Exception ex) { response.Failed(ex); } return(response); }
public async Task <DeleteFavoriteResponse> DeleteFavoriteAsync(DeleteFavoriteRequest request, DeleteFavoriteResponse response) { try { response = await _weatherDataLayer.DeleteFavoriteAsync(request, response).ConfigureAwait(false); if (response.IsSuccess) { response.Success("DeleteFavoriteAsync"); } else { response.Failed("WeatherWorkflow:DeleteFavoriteAsync"); } } catch (Exception ex) { response.Failed(ex); } return(response); }
public async Task <DeleteFavoriteResponse> DeleteFavoriteAsync([FromBody] DeleteFavoriteRequest request) { var response = new DeleteFavoriteResponse(); try { response = await _weatherWorkflow.DeleteFavoriteAsync(request, response).ConfigureAwait(false); if (response.IsSuccess) { response.Success("DeleteFavoriteAsync"); } else { response.Failed("WeatherController:DeleteFavoriteAsync"); } } catch (Exception ex) { response.Failed(ex); } return(response); }