Esempio n. 1
0
 public List <CustomerDTO> GetCustomer(int?customerID)
 {
     try
     {
         var customers = CustomersRepo.All().Where(c => customerID == null || customerID == 0 || c.ID == customerID).ToList();
         return(CustomerDTO.GetList(customers).ToList());
     }
     catch (Exception ex)
     {
         _logger.LogCritical(ex.Message);
         throw ex;
     }
 }
Esempio n. 2
0
 public List <CustomerDTO> GetCustomersVehicles()
 {
     try
     {
         var customersList = CustomersRepo.All().Include(v => v.Vehicles).ToList();
         return(CustomerDTO.GetList(customersList).ToList());
     }
     catch (Exception ex)
     {
         _logger.LogCritical(ex.Message);
         throw ex;
     }
 }
Esempio n. 3
0
        public List <CustomerDTO> GetCustomersVehiclesByStatus(bool status)
        {
            var customersList = CustomersRepo.All().Include(c => c.Vehicles.Where(v => v.CurrentStatus == status)).ToList();

            return(CustomerDTO.GetList(customersList).ToList());
        }