Мне нужно уметь экземпляр дочернего объекта экземпляру родительского объекта.
public class Parent
{
public string name{get;set;}
}
public class Child : Parent{}
var myClass = new Child()
(Parent)myClass
//this doesnt seem to work and the object still has childs type.
есть ли другой способ сделать это?
спасибо