Answers for "c# create class from parent class"

C#
0

c# create class from parent class

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);
        }
    }
}
Posted by: Guest on June-17-2021

Code answers related to "c# create class from parent class"

C# Answers by Framework

Browse Popular Code Answers by Language