Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Truck truck = new Truck();
- truck.CabType = "Extended";
- truck.Wheels = 18;
- truck.Color = "white";
- truck.Doors = 37;
- Car car = new Car() { Doors = 4, Color = "blue", Wheels = 4, Seats = 4 };
- Truck lucasPickup = new Truck() { Wheels = 4, Color = "black", Doors = 4, CabType = "quadcab"};
- Car mikesMini = new Car() { Doors = 3, Color = "Green", Wheels = 4, Seats = 3 };
- ObjectDelta carDiff = car.Compare(mikesMini);
- ObjectDelta truckDiff = truck.Compare(lucasPickup);
- Console.WriteLine("Car Differences:");
- foreach(PropertyDelta ds in carDiff.PropertyDeltas)
- {
- Console.WriteLine(ds.PropertyName + " Previous Value: " + ds.Value1.ToString() + " : New Value: " + ds.Value2.ToString());
- }
- Console.WriteLine("Truck Differences:");
- foreach (PropertyDelta ds in truckDiff.PropertyDeltas)
- {
- Console.WriteLine(ds.PropertyName + " Previous Value: " + ds.Value1.ToString() + " : New Value: " + ds.Value2.ToString());
- }
- Console.Read();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement