I have 2 classes:
public class Place
{
public string GoogleReference { get; set; }
public string GoogleID { get; set; }
public string Name { get; set; }
public string Vicinity { get; set; }
}
public class PlaceDetail : Place
{
public string Url { get; set; }
public string InternationalPhoneNumber { get; set; }
public string Website { get; set; }
}
How to cast Place to PlaceDetail? Next code does not work
Place place = new Place();
place.Name = "A";
....
PlaceDetail placeDetail = (PlaceDetail)place;
Unable to cast object of type 'PlacesLibrary.Place' to type 'PlacesLibrary.PlaceDetail'.