缓存出了问题!!!
CapturePositionHandler capHandler = new CapturePositionHandler();
capHandler.CapturePositionInfoEditAdd(captureInfo)
以下就是这个CapturePositionInfoEditAdd方法体
public int CapturePositionInfoEditAdd(CapturePositionInfo model) {
int rowsAffect = capturepositioninfoAssembly.CapturePositionInfoEditAdd(model);
return rowsAffect;
}
这个时候就要开始缓存了
private static readonly ICapturePosition capturepositioninfoAssembly = CreateIData.CreateCapturePositionInfo();
class CreateIData
{
public static readonly string DataProviderAssembly = ConfigManager.DataProviderAssembly;
public CreateIData() { }
//传入程序集类型,使用系统激活器创建实例,并存入缓存
private static object CreateObject(string assemblyPath, string CacheKey) {
object objType = DataCache.GetCache(CacheKey);
if (objType == null) {
try
{
objType = Assembly.Load(assemblyPath).CreateInstance(CacheKey);
DataCache.SetCache(CacheKey, objType);// 写入缓存
}
catch (System.Exception err) {
throw new Exception(err.Message);
}
}
return objType;
}
//创建CapturePositionInfo接口
public static ICapturePosition CreateCapturePositionInfo() {
string CacheKey = DataProviderAssembly + ".CapturePositionProvider";
object objType = CreateObject(DataProviderAssembly, CacheKey);
return (ICapturePosition)objType;
}
}
在这里会出错了