コード例 #1
0
        public ModelMessageResult <TagModel> handleAdded(TagModel model)
        {
            var             req    = new TagFieldsRequest(model);
            IDMessageResult result = APIRequest.createTag(req).GetAwaiter().GetResult();

            Result <TagModel> get_result = APIRequest.getTagById(result.Id).GetAwaiter().GetResult();

            return(new ModelMessageResult <TagModel>(result.Error, result.Message, get_result.Items.FirstOrDefault()));
        }
コード例 #2
0
        public static async Task <IDMessageResult> createTag(TagFieldsRequest model)
        {
            var response = await client.PostAsJsonAsync(TAGS, model);

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