internal static ICommonOrderDataArticle Copy(ICommonOrderDataArticle commonOrderDataArticle) { var article = new CommonOrderDataArticle(); CopyPropertiesTo(commonOrderDataArticle, article); return article; } public static void CopyPropertiesTo<T>(T source, T dest) { var plist = typeof(T).GetProperties().Where(x => x.CanRead && x.CanWrite).ToList(); foreach (var prop in plist) prop.SetValue(dest, prop.GetValue(source, null), null); }
789200cookie-checkC# copy interface properties