public async Task <IEnumerable <SimpleArticle> > GetArticleList(bool isGetContent = false, bool isOnlyPublished = false) { var responseMessage = await _articleProvider.GetArticles(isGetContent, isOnlyPublished); return(responseMessage.StateCode != Define.StateCode.OK ? new List <SimpleArticle>() : _mapper.Map <IEnumerable <ArticleDto>, IEnumerable <SimpleArticle> >(responseMessage.Entity ?? new List <ArticleDto>())); }
public async Task <IEnumerable <Doc> > RetrieveArticles(string search, DateTime?startDate, DateTime?endDate) { string start = startDate.Value.ToString("yyyyMMdd"); string end = endDate.Value.ToString("yyyyMMdd"); // string start = DateTime.MaxValue.ToString("yyyyMMdd"); // string end = DateTime.MinValue.ToString("yyyyMMdd"); RootObject rootObject = await _articleProvider.GetArticles(search, start, end); var docs = this.TakeDocs(rootObject); //return await this.SetArticlesStatus(docs); return(docs); }