Exemplo n.º 1
0
        public IQueryable <Vehicle> ReadAll()
        {
            IQueryable <Vehicle> vehicles;

            vehicles = vehiclesRepository.ReadAll();
            return(vehicles);
        }
Exemplo n.º 2
0
 public ActionResult <IEnumerable <VehicleModel> > ReadAll()
 {
     try
     {
         return(Ok(_repository.ReadAll()));
     }
     catch (Exception ex)
     {
         _logger.LogError($"Error: controller exception on ReadAll()");
         return(StatusCode((int)HttpStatusCode.InternalServerError, $"Error: {ex.Message}"));
     }
 }