///
/// 创建对象或从缓存获取
///
public static object CreateObject(string AssemblyPath, string ClassNamespace)
{
object objType = DataCache.GetCache(ClassNamespace);//从缓存读取
if (objType == null)
{
try
{
objType = Assembly.Load(AssemblyPath).CreateInstance(ClassNamespace);//反射创建
DataCache.SetCache(ClassNamespace, objType);// 写入缓存
}
catch (System.Exception ex)
{
LogHelper.WriteLog(typeof(DataAccess), LogType_Enum.Error, ex);
return null;
}
}
return objType;
}
2023-03-07 10:22:59
751KB
工厂、
1