public ModelMessageResult <SongModel> handleEdited(SongModel model, IUpdater <SongModel> updater) { var req = new SongUpdateRequest(updater.createRequestModel(model)); MessageResult result = APIRequest.updateSong(req).GetAwaiter().GetResult(); Result <SongModel> get_result = APIRequest.getSongById(req.Id).GetAwaiter().GetResult(); return(new ModelMessageResult <SongModel>(result.Error, result.Message, get_result.Items.FirstOrDefault())); }
public static async Task <MessageResult> adminUpdateSong(SongUpdateRequest model) { var response = await client.PatchAsJsonAsync(SONGS + $"admin/{model.Id}", model); return(await response.Content.ReadAsAsync <MessageResult>()); }