public IActionResult Create() { var depto = _departmentsService.FindAll(); SellerFormViewModel viewModel = new SellerFormViewModel(depto); return(View(viewModel)); }
// GET: Sellers/Create public async Task <IActionResult> Create() { try { var departments = await _departmentsService.FindAll(); var viewModel = new SellerFormViewModel { Departments = departments.ToList() }; return(View(viewModel)); } catch (ApplicationException app) { return(RedirectToAction(nameof(Error), new { message = app.Message })); } }
// GET: Departaments public async Task <IActionResult> Index() { var departments = await _departmentsService.FindAll(); return(View(departments)); }
public IActionResult Index() { var list = _departmentsService.FindAll(); return(View(list)); }