本文整理匯總了C#中System.PageInfo.ToJSON_Newtonsoft方法的典型用法代碼示例。如果您正苦於以下問題:C# PageInfo.ToJSON_Newtonsoft方法的具體用法?C# PageInfo.ToJSON_Newtonsoft怎麽用?C# PageInfo.ToJSON_Newtonsoft使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.PageInfo
的用法示例。
在下文中一共展示了PageInfo.ToJSON_Newtonsoft方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ApiUrl = "http://122.224.201.244/ychapitest/api/V1/Tywcomment/SearchPage";
PageInfo pi = new PageInfo();
pi.PageIndex = 1;
pi.PageSize = 50;
pi.AddCondition<TywcommentDTO>(o => o.datasource, BasePage.Target, QueryMethod.Equal);
pi.AddCondition<TywcommentDTO>(o => o.objecttype, (int)評論類型.遊記, QueryMethod.Equal);
pi.AddCondition<TywcommentDTO>(o => o.objectid, "921b7cc7-78c1-486e-96bf-0f26ac68ea7d", QueryMethod.Equal);
pi.AddCondition<TywcommentDTO>(o => o.replyid, "0", QueryMethod.Equal);
pi.OrderBy.Add("create_date", OrderByType.Desc);
//Response.Write(pi.ToSqlCondition());
HttpClient client = new HttpClient();
var strJson = pi.ToJSON_Newtonsoft();
HttpContent httpContent = new StringContent(strJson);
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var v = client.PostAsync(ApiUrl, httpContent).Result.Content.ReadAsStringAsync().Result;
Response.Write(v);
}