/// <summary> /// Deletes the Multidetail. /// </summary> /// <param name="details">The details.</param> /// <returns></returns> public async Task <APIResponse> DeleteMultiDetails(MultidetailIdDetai details) { try { var client = httpClientFactory.CreateClient(ECommerceServiceOperation.serviceName); var response = await client.DeleteAsync(servicesConfig.ECommerce + ECommerceServiceOperation.DeleteMultiDetails(details.MultidetailId)); return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'DeleteMultiDetails()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }
/// <summary> /// Updates the Multidetail. /// </summary> /// <param name="details">The details.</param> /// <param name="request">The request.</param> /// <returns></returns> public async Task <APIResponse> UpdateMultiDetails(MultidetailIdDetai details, UpdateMultidetailEcommerceRequest request) { try { var client = httpClientFactory.CreateClient(ECommerceServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PutAsync(servicesConfig.ECommerce + ECommerceServiceOperation.UpdateMultiDetails(details.MultidetailId), contentPost); return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'UpdateMultiDetails()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }