public UnitOfWork Uow = new UnitOfWork(new ApplicationDbContext());// { get; set; } // // GET: /Product/ public ActionResult Index() { var products = Uow.Products.GetAll(); var brands = Uow.Brand.GetAll(); var partModels = Uow.PartModel.GetAll(); ProductsHomeViewModel vm = new ProductsHomeViewModel { Products = products.ToList(), Brands = brands.ToList(), PartModels = partModels.ToList() }; return(View(vm)); }
public IEnumerable <ProductsHomeViewModel> Get() { var products = Uow.Products.GetAll(); var brands = Uow.Brand.GetAll(); var partModels = Uow.PartModel.GetAll(); ProductsHomeViewModel vm = new ProductsHomeViewModel { Products = products.ToList(), Brands = brands.ToList(), PartModels = partModels.ToList() }; yield return(vm); }