public ActionResult BuyerList(string term) { var buyers = _buyerService.GetBuyers(new GetBuyersRequest { Skip = 0, Take = 20, Term = term, }).Buyers; return(Json(new { results = buyers }, JsonRequestBehavior.AllowGet)); }
public IActionResult GetBuyer(int id, [FromServices] IBuyerService service) { Dto foundBuyer = Wrapper.GetMapper.Map <Dto>(service.GetBuyer(id)); var listOfAllBuyers = service.GetBuyers(); var fixedListOfBuyers = listOfAllBuyers .Except(foundBuyer.ElementAsList()); foundBuyer.Buyers = fixedListOfBuyers.ToList(); foundBuyer.buyerInDropdown = $"{foundBuyer.Name} {foundBuyer.Surname}"; return(View("Index", foundBuyer)); }
public IActionResult Index([FromServices] IBuyerService service) => View(new Dto { Buyers = service.GetBuyers() });