using System; using System.Collections.Generic; using HcUtility.Core; namespace DSWeb.MvcShipping.Helper { public class ModelObjectConvert where T:ModelObjectBase { private static ModelObjectBase Converter(T inputObject) { return inputObject; } public static List ToModelObjectList(List objList) { if (objList == null) return null; return objList.ConvertAll(new Converter(Converter)); } public static List> ToExtendList(List objList) {//将扩展数据属性的对象列表中的扩展属性值转化为List> if (objList == null) return null; else { var result = new List>(); foreach (var obj in objList) { result.Add(obj.ExtendDic); } return result; } } } }