コード例 #1
0
        private IEnumerable <MvcCategory> GetAllOrFind(string searchString)
        {
            IEnumerable <BLLCategory> allCategories = categories.GetAll();
            List <MvcCategory>        mvcCategories = allCategories.Select(c => CategoryMapper.GetMVCEntity(c)).ToList();

            if (!ReferenceEquals(searchString, null) && searchString != "")
            {
                mvcCategories = mvcCategories.Where(s => s.Name.Contains(searchString)).ToList();
            }
            return(mvcCategories);
        }
コード例 #2
0
        public ActionResult EditCategory(int id)
        {
            MvcCategory category = CategoryMapper.GetMVCEntity(categories.Get(id));

            return(View(category));
        }