Car myCar = new Car("Honda", "Civic", "2019"); myCar.Color = "Black"; myCar.Price = 20000; IVehicleRepository vehicleRepository = new VehicleDatabaseRepository(); vehicleRepository.Add(myCar);
Bike myBike = new Bike("Trek", "Fuel EX", "2021"); myBike.FrameSize = "M"; myBike.WheelSize = 29; IVehicleRepository vehicleRepository = new VehicleListRepository(); vehicleRepository.Add(myBike);This code creates a new Bike object and sets its properties. Then, it creates an instance of a class that implements the IVehicleRepository interface and calls its Add method to add the bike to a list. Package Library: This interface is not associated with any package library. It can be implemented in any C# project that requires vehicle management functionality.