コード例 #1
0
ファイル: TagService.cs プロジェクト: vinodkca/Tags
 public bool InsertTagResult(TagResult objTagResult)
 {
     if (objTagResult != null)
     {
         InsertTagHierarchy(objTagResult.lstTagsHierarchy);
         InsertTag(objTagResult.lstTagNames);
         InsertTitle(objTagResult.lstTitleNames);
         return(true);
     }
     return(false);
 }
コード例 #2
0
ファイル: HttpService.cs プロジェクト: vinodkca/Tags
        public static async Task <bool> GetTagsAll(TagResult objResult)
        {
            string strTagsAllPath = AppSetting.API_URL_TAGS;

            HttpResponseMessage resp = await client.GetAsync(strTagsAllPath);

            if (resp.IsSuccessStatusCode)
            {
                Stream received = await resp.Content.ReadAsStreamAsync();

                StreamReader readStream = new StreamReader(received);
                string       jsonString = readStream.ReadToEnd();

                JObject jo = JObject.Parse(jsonString);
                objResult.lstTagsHierarchy = PopulateTagHierarchy(jo);
                objResult.lstTagNames      = PopulateTagNames(jo);
                objResult.lstTitleNames    = PopulateTitleNames(jo);
                return(true);
            }
            return(false);
        }