最初由 mo_yuan_ming 发布 [B] [PHP] public static EmrcWebCenter.IDAL.IEntity<T> CreateInstance<T>() { Type type = typeof(T); string className = path + ".Entity`1[[" +type.FullName + "," + type.Assembly.FullName + "]]"; EmrcWebCenter.IDAL.IEntity<T> Instance = (EmrcWebCenter.IDAL.IEntity<T>Assembly.Load(path).CreateInstance(className); return Instance; } [/PHP] 用以上格式就OK 实现采用反射工厂来获取实例 [/B]
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页