public IActionResult Add() => View(new PartFormModel { Suppliers = Suppliers.All().Select(s => new SelectListItem { Text = s.Name, Value = s.Id.ToString() }) });
public IActionResult ByType(string type) { if (type == null) { type = "Local"; } bool local = true; if (type == "Local") { local = true; } else if (type == "Importers") { local = false; } var result = suppliers.All(local); return(View(new SuppliersByTypeViewModel { Type = type, Suppliers = result })); }
public List <Supplier> All() { return(supplierService.All()); }