Esempio n. 1
0
        public IEnumerable <New> GetAllNews(string keyword, out int totalApproval)
        {
            totalApproval = _newRepository.GetMulti(x => x.NewCategoryID == Common.CommonConstants.NewID1 && x.Status == false).Count();

            if (!string.IsNullOrEmpty(keyword))
            {
                return(_newRepository.GetMulti(n => (n.Name.Contains(keyword) || n.ApplicationUser.FullName.Contains(keyword)) && n.NewCategoryID == Common.CommonConstants.NewID1 && n.Status == true, new string[] { "ApplicationUser" }));
            }
            else
            {
                return(_newRepository.GetMulti(x => x.NewCategoryID == Common.CommonConstants.NewID1 && x.Status == true, new string[] { "ApplicationUser" }));
            }
        }