📜  c# 从父类创建类 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:57.039000             🧑  作者: Mango

代码示例1
public class ChildClass : ParentClass
{


    public ChildClass(ParentClass ch)
    {
        foreach (var prop in ch.GetType().GetProperties())
        {
            this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(ch, null), null);
        }
    }
}