工厂

using System.Reflection;
using System.Configuration;

static string path = ConfigurationManager.AppSettings["dal"];//"DAL";
public T create<T>(string typeName)
{
return (T)Assembly.Load(path).CreateInstance(path + typeName);
}

return factory.create<daladd>(".daladd").add(model);

<appSettings>

<add key="dal" value="DAL"/>
</appSettings>

原文地址:https://www.cnblogs.com/wsl0608/p/10002816.html