Esempio n. 1
0
        public ModelMessageResult <SongModel> handleAdded(SongModel model)
        {
            var             req    = new SongFieldsRequest(model);
            IDMessageResult result = APIRequest.createSong(req).GetAwaiter().GetResult();

            Result <SongModel> get_result = APIRequest.getSongById(result.Id).GetAwaiter().GetResult();

            return(new ModelMessageResult <SongModel>(result.Error, result.Message, get_result.Items.FirstOrDefault()));
        }
Esempio n. 2
0
        public static async Task <IDMessageResult> createSong(SongFieldsRequest model)
        {
            var response = await client.PostAsJsonAsync(SONGS, model);

            return(await response.Content.ReadAsAsync <IDMessageResult>());
        }