Beispiel #1
0
        public ModelMessageResult <RatingModel> handleAdded(RatingModel model)
        {
            var             req    = new RatingFieldsRequest(model);
            IDMessageResult result = APIRequest.createRating(req).GetAwaiter().GetResult();

            Result <RatingModel> get_result = APIRequest.getRatingById(result.Id).GetAwaiter().GetResult();

            return(new ModelMessageResult <RatingModel>(result.Error, result.Message, get_result.Items.FirstOrDefault()));
        }
Beispiel #2
0
        public static async Task <IDMessageResult> createRating(RatingFieldsRequest model)
        {
            var response = await client.PostAsJsonAsync(RATINGS, model);

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