public async Task <IActionResult> Origins() { var origins = await _repository.GetAll(); var viewModel = new OriginsViewModel { Origins = _mapper.Map <IEnumerable <Origin>, IEnumerable <OriginViewModel> >(origins) }; return(View(viewModel)); }
public ActionResult Add() { var cat = GetAllCategories(); ViewBag.Categories = new SelectList(cat, "Id", "Name"); var origin = _origin.GetAll(); ViewBag.Origin = new SelectList(origin, "Id", "Name"); var brand = _brand.GetAll(); ViewBag.Brand = new SelectList(brand, "Id", "Name"); var hashtag = new HashtagController(_tag).GetAll(); ViewBag.Hashtag = new MultiSelectList(hashtag, "Name", "Name"); ViewBag.Title = "Thêm sản phẩm"; return(View(new ProductModel())); }
public IEnumerable <Origin> GetAllOrigin() { var result = _origin.GetAll(); return(result); }
public ActionResult GetAll() { var data = _origin.GetAll(); return(Json(data)); }