/// <summary> /// 将待执行插入的对象转化到BulkCopyModel 对象模型中 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="o"></param> /// <param name="bulkCopyModels"></param> public static BulkCopyModel BulkCopy <T>(this T o) where T : BaseModel, new() { BulkCopyModel copyModel = new BulkCopyModel(); copyModel.CopyModel = o; return(copyModel); }
public static List <BulkCopyModel> BulkCopy <T>(this List <T> o) where T : BaseModel, new() { List <BulkCopyModel> bulks = new List <BulkCopyModel>(); foreach (T item in o) { BulkCopyModel copyModel = new BulkCopyModel(); copyModel.CopyModel = item; bulks.Add(copyModel); } return(bulks); }