public static T GetInstance<T>(ExplicitArguments args); // // Summary: // Creates a new instance of the requested type T using the supplied Instance. // Mostly used internally // // Parameters: // instance: public static T GetInstance<T>(Insta…
转:http://blog.sina.com.cn/s/blog_659a572b0100xp5s.html 例子如下 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MvcApplication2.Models; using DataAccess; using System.Configuration; using S…
普通类实现字符串创建实例: var type =Assembly.Load("SqlSugar").GetType("SqlSugar.SqlServerDb"); IDb IDb=(IDb)Activator.CreateInstance(type, true); 泛型类就比较坑了,花了我一些时间,下面是泛型类的使用方法: var type =Assembly.Load("SqlSugar").GetType("SqlSugar.Sq…