public async void UpdateAsync(PersonEventRelation personEventRelation) { var address = string.Format("{0}/{1}", UpdateUrl, personEventRelation.PersonEventRelationId); using (var httpClient = new HttpClient()) { var response = await httpClient.PostAsJsonAsync <PersonEventRelation>(address, personEventRelation); if (!response.IsSuccessStatusCode) { var apiErrorModel = await response.Content.ReadAsAsync <ApiErrorModel>(); throw new ApiErrorException(apiErrorModel); } } }
public async Task <PersonEventRelation> SaveAsync(PersonEventRelation personEventRelation, string pictureName) { //var address=string using (var httpClient = new HttpClient()) { var response = await httpClient.PostAsJsonAsync(SaveUrl, personEventRelation); if (response.IsSuccessStatusCode) { return(await response.Content.ReadAsAsync <PersonEventRelation>()); } else { var apiErrorModel = await response.Content.ReadAsAsync <ApiErrorModel>(); throw new ApiErrorException(apiErrorModel); } } }
public async Task <PersonEventRelation> SaveAsync(PersonEventRelation personEventRelation) { return(await HttpClientUtils.PostJsonAsync <PersonEventRelation, PersonEventRelation>(SAVE_URL, personEventRelation)); }
public async Task UpdateAsync(PersonEventRelation personEventRelation) { var address = string.Format("{0}/{1}", UPDATE_URL, personEventRelation.PersonEventRelationId); await HttpClientUtils.PostJsonNoReturnAsync <PersonEventRelation>(address, personEventRelation); }