Hi,
i have an UI object VehicleUI which is inherited from Vehicle. It's the same, but it has some extra propertys for the user entry process.
Now i want to save the VehicleUI to the database in the table Vehicle (using the entityframework). In my opinion this must be possbile because the VehicleUI has all the properties of the Vehicle, plus some extra. I can call the context.AddToVehicle, but at runtime i get an error saying there is no mapping for the VehicleUI ( which is correct, because i have only a mapping for the Vehicle)
So i tried casting the VehicleUI to a Vehicle and then save it, but even when i cast it the Type still remains a VehicleUI and not a Vehicle.
So want i want to do is create a new fresh Vehicle object based on the VehicleUI object, but ofcourse without me typing vehicle.x = vehicleui.x, vehicle.y = vehicleui.y etc etc
Is there a way to create a new vehicle and say: i give you an inherited object, please copy all the info from the propertys you have in common.
Michel