Пример #1
0
        public SkillsController(ISkillsContext context, ISkillsRepository<Skill> skillsRepository)
        {
            _context = context;
            _skillsRepository = skillsRepository;

            Mapper.AddProfile<SkillsMappingProfile>();
        }
Пример #2
0
        // GET: HomePage
        public ActionResult Index()
        {
            ISkillsContext    iSkillsContext = new ISkillsContext();
            List <Categories> categories     = iSkillsContext.Categories.ToList();

            return(View(categories));
        }
Пример #3
0
        public ActionResult CategoryProduct(int id)
        {
            ISkillsContext iSkillsContext = new ISkillsContext();
            //  List<Categories> categories = iSkillsContext.Categories.ToList();

            IEnumerable <Product> product = iSkillsContext.Products.Where(x => x.CategoryID == id);

            //  if(product.)
            return(PartialView("_CategoryProduct", product));
            // return View(product);
        }