public IActionResult DriversTable() { //var x = DriverService.GetAllDrivers(); try { var viewModel = new DriversViewModel { Drivers = DriverService.GetAllDrivers() }; return(View(viewModel)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult DriversTable() { try { var driversViewModel = new DriversListViewModel() { Drivers = driverService.GetAllDrivers() }; return(PartialView("_DriversTablePartial", driversViewModel)); } catch (Exception e) { logger.LogError("Failed to load Driver entities {@Exception}", e.Message); logger.LogDebug("Failed to load Driver entities {@ExceptionMessage}", e); return(BadRequest("Failed to load Driver entities")); } }
public IEnumerable <Driver> GetAllDrivers() { return(driverService.GetAllDrivers()); }
public async Task <IActionResult> DriverSearch() { var drivers = await driverService.GetAllDrivers(); return(View(drivers)); }