Exemple #1
0
        public static IList <T> DeepCloneList <T>(this IList <T> tList) where T : class
        {
            IList <T> listNew = new List <T>();

            foreach (var item in tList)
            {
                listNew.Add(TransExpV2 <T, T> .Trans(item));
            }
            return(listNew);
        }
Exemple #2
0
 /// <summary>
 /// Copy Propertys and Fileds
 /// 拷贝属性和公共字段
 /// </summary>
 /// <typeparam name="T"> </typeparam>
 /// <param name="source"></param>
 /// <param name="target"></param>
 public static T1 CopyToAll <T, T1>(this T source) where T : class
 {
     return(TransExpV2 <T, T1> .Trans(source));
 }
Exemple #3
0
 public static T DeepCloneObject <T>(this T t) where T : class
 {
     return(TransExpV2 <T, T> .Trans(t));
 }