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; } }
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; } }
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()); }