public ModelMessageResult <RatingModel> handleEdited(RatingModel model, IUpdater <RatingModel> updater) { var req = new RatingUpdateRequest(updater.createRequestModel(model)); MessageResult result = APIRequest.updateRating(req).GetAwaiter().GetResult(); Result <RatingModel> get_result = APIRequest.getRatingById(req.Id).GetAwaiter().GetResult(); return(new ModelMessageResult <RatingModel>(result.Error, result.Message, get_result.Items.FirstOrDefault())); }
public static async Task <MessageResult> updateRating(RatingUpdateRequest model) { var response = await client.PostAsJsonAsync(RATINGS + $"{model.Id}", model); return(await response.Content.ReadAsAsync <MessageResult>()); }