Esempio n. 1
0
        public ActionResult Index()
        {
            var dbModel = _vehicleBusiness.GetAll();
            var model   = Mapper.Map <List <VehicleModel>, List <VehicleViewModel> >(dbModel);

            return(View("VehiclesList", model));
        }
Esempio n. 2
0
 public ActionResult <IEnumerable <Vehicle> > GetAll()
 {
     try
     {
         IEnumerable <Vehicle> vehicles = _vehicleBusiness.GetAll();
         return(Ok(vehicles));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Esempio n. 3
0
 public ActionResult<IEnumerable<Vehicle>> List()
 {
     return _vehicleBusiness.GetAll().ToList();
 }
Esempio n. 4
0
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await _vehicleBusiness.GetAll()));
 }