public static TChild AutoCopy<TParent, TChild>(TParent parent) where TChild : TParent, new()
{
TChild child = new TChild();
var ParentType = typeof(TParent);
var Properties = ParentType.GetProperties();
foreach (var Propertie in Properties)
{
if (Propertie.CanRead && Propertie.CanWrite)
{
Propertie.SetValue(child, Propertie.GetValue(parent, null), null);
}
}
return child;
}