コード例 #1
0
        internal Availability GetHallAvbDetails(int userky, string hallid)
        {
            HttpResponseMessage response = httpClient.GetAsync("api/GetHallAvbDetails?userky=" + userky + "&hallid=" + hallid + "").Result;
            Availability        hall     = new Availability();

            if (response.IsSuccessStatusCode)
            {
                string jstr = response.Content.ReadAsStringAsync().Result;
                DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Availability));
                Availability deserializeditems        = new Availability();
                MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jstr));
                DataContractJsonSerializer ser = new DataContractJsonSerializer(deserializeditems.GetType());
                deserializeditems = ser.ReadObject(ms) as Availability;
                hall = deserializeditems;
            }
            return(hall);
        }