public List<ArticleComment> GetListByArticleIdStatus(int ArticleId, string status)
 {
     using (ArticleEntities dbContext = new ArticleLibrary.ArticleEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         System.Data.Objects.ObjectResult<ArticleComment> obj_result = dbContext.sp_ArticleComments_GetList();
         IQueryable<ArticleComment> query = obj_result.AsQueryable();
         if (ArticleId>0)
             query = query.Where(x => x.ArticleId == ArticleId);
         if (!string.IsNullOrEmpty(status))
             query = query.Where(x => x.Publish == status);
         return query.ToList();
     }
 }
Пример #2
0
 public List <ArticleComment> GetListByArticleIdStatus(int ArticleId, string status)
 {
     using (ArticleEntities dbContext = new ArticleLibrary.ArticleEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         System.Data.Objects.ObjectResult <ArticleComment> obj_result = dbContext.sp_ArticleComments_GetList();
         IQueryable <ArticleComment> query = obj_result.AsQueryable();
         if (ArticleId > 0)
         {
             query = query.Where(x => x.ArticleId == ArticleId);
         }
         if (!string.IsNullOrEmpty(status))
         {
             query = query.Where(x => x.Publish == status);
         }
         return(query.ToList());
     }
 }