public static void Call(IVehicles vehicle)
 {
     Object someIrrelevantObject = vehicle.SomeValue;
     //here my change begins
     IPersonalVehicles personalVehicle = (IPersonalVehicles)vehicle;
     long somePersonalValue            = personalVehicle.SomePersonalValue;
 }
Пример #2
0
 public VehiclesController(IMapper _mapper, IVehicles vehicle, IMakes makes, IUnitOfWork unitOfWork)
 {
     mapper          = _mapper;
     this.vehicle    = vehicle;
     this.makes      = makes;
     this.unitOfWork = unitOfWork;
 }
Пример #3
0
        public int SendVehicleTo(int garageSlot, IStorage deliveryLocation)
        {
            IVehicles vehicle = GetVehicle(garageSlot);

            if (garage.Contains(null) == false)
            {
                throw new InvalidOperationException("No room in garage!");
            }

            return(3);

            //Then, the method checks if there are any free garage slots.A free garage slot is denoted by a null value.
            //If there is no free garage slot, throw an InvalidOperationException with the message "No room in garage!".
            //Then, the garage slot in the source storage is freed and the vehicle is added to the first free garage slot.
            //The method returns the garage slot the vehicle was assigned when it was transferred.
        }
Пример #4
0
 public VehiclesViewModel(IVehicles vehicles)
 {
     _vehicles   = vehicles;
     VehicleRows = new ObservableCollection <VehicleRowViewModel>();
     _vehicles.ListVehicles("secret", callback);
 }