Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        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());
 }
Ejemplo n.º 4
0
        public async Task <IActionResult> DriverSearch()
        {
            var drivers = await driverService.GetAllDrivers();

            return(View(drivers));
        }