public static T Clone(this T source) where T : class { T nobj = (T)Activator.CreateInstance(typeof(T)); var props = typeof(T).GetProperties(); foreach (var p in props) { p.SetValue(nobj, p.GetValue(source)); } return nobj; }