创建实例
当构造方法被私有化
cs
Setting copy =
(Setting)FormatterServices.GetUninitializedObject(dbSetting.GetType());
常规手法
cs
var copy = Activator.CreateInstance(typeof(Setting)) ;
修改属性
cs
Type type = typeof(Setting);
type.GetProperty("Name").SetValue(copy, sourceSetting.Name);