public static ArticleCategory GetDetailByCode(string code)
 {
     using (ArticleEntities dbContext = new ArticleEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         var query = (from x in dbContext.ArticleCategories
                      where x.CategoryCode.Trim() == code
                      select x).SingleOrDefault();
         return query;
     }
 }
 public static List<ArticleCategory> GetAllChildrenNodesOfSelectedNode(string CategoryCode, string CultureCode, string Status)
 {
     using (ArticleEntities dbContext = new ArticleEntities())
     {
         dbContext.CommandTimeout = Settings.CommandTimeout;
         System.Data.Objects.ObjectResult<ArticleCategory> obj_result = dbContext.ArticleCategories_GetAllChildrenNodesOfSelectedNode(CategoryCode);
         var query = obj_result.AsQueryable();
         if (!string.IsNullOrEmpty(CultureCode))
             query = query.Where(x => x.CultureCode.Trim() == CultureCode);
         if (!string.IsNullOrEmpty(Status))
             query = query.Where(x => x.Status.Trim() == Status);
         return query.ToList();
     }
 }