示例#1
0
 public async Task <HttpMessage <New> > New(string lang, int id)
 => await TryCatchResponseAsync(async() =>
 {
     return(await Task.Run(() =>
     {
         NewEdit newEdit = CmsController.GetNewEdit(this, id);
         newEdit = CmsController.GetEditContent(this, @"New\[get_content]", newEdit);
         New result = new New(lang, newEdit);
         return CreateResponseOk(result);
     }));
 });
示例#2
0
 public async Task <HttpMessage <List <New> > > News(string lang, int pageRows, int page)
 => await TryCatchResponseAsync(async() =>
 {
     return(await Task.Run(() =>
     {
         List <NewEdit> news = CmsController.GetNews(this, pageRows, page);
         List <New> result = new List <New>(news.Count);
         for (int i = 0, icount = news.Count; i < icount; i++)
         {
             result.Add(new New(lang, news[i]));
         }
         return CreateResponseOk(result);
     }));
 });