コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private bool GetWebApiResponseUtf8Bom()
        {
            string value = ConfigurationManager.AppSettings["WebApiResponseUtf8Bom"];

            if (string.IsNullOrWhiteSpace(value))
            {
                return(false);
            }
            ExtBooleanConverter booleanConverter = new ExtBooleanConverter();

            return((bool)booleanConverter.ConvertFrom(value));
        }
コード例 #2
0
ファイル: Book.cs プロジェクト: TonyZhangshi81/Example_MVC
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(string id)
        {
            var apiRequestHttp = new ApiRequestHttp();

            var requestAll = new
            {
                metadata = new { requestid = "DEL01" },
                request  = new { id = id }
            };

            apiRequestHttp.HttpPostSync(@"http://localhost/BookServer/BookService.svc/Delete", requestAll);

            var json   = apiRequestHttp.OutputJson;
            var result = ApiRequestHttp.Deserialize <ResponseObject <ResponseMetadata, ApiDeleteBookWithIdResponse> >(json);

            ExtBooleanConverter booleanConverter = new ExtBooleanConverter();

            return((bool)booleanConverter.ConvertFrom(result.Response.Result));
        }