/// <summary> /// 获取 BLL 业务逻辑层 大接口 /// </summary> /// <returns></returns> public IBLLSession GetBLLSession() { //从当前线程中 获取 DBContext 数据仓储 对象 IBLLSession iBLLSession = System.Runtime.Remoting.Messaging.CallContext.GetData(typeof(BLLSessionFactory).Name) as IBLLSession; if (iBLLSession == null) { //通过反射创建 IDbSession //1.通过配置文件获取dll的位置 string dllPath = Common.ConfigurationHelper.AppSettingMapPath("BLLSessionFactoryDLL"); //string dllPath = System.Configuration.ConfigurationSettings.AppSettings["BLLSessionFactoryDLL"].ToString(); //2.通过配置文件获取 DbSessionFactory 的全名称 string factoryType = Common.ConfigurationHelper.AppSetting("BLLSessionFactoryType"); //3.通过反射创建实例 //3.1加载程序集 Assembly dll = Assembly.LoadFrom(dllPath); //3.2获得DbSessionFactory 的 Type Type tFactory = dll.GetType(factoryType); //3.3反射创建 IBLLSessionFactory 实体对象 IBLLSessionFactory BLLSession = Activator.CreateInstance(tFactory) as IBLLSessionFactory; iBLLSession = BLLSession.GetBLLSession(); System.Runtime.Remoting.Messaging.CallContext.SetData(typeof(BLLSessionFactory).Name, iBLLSession); } return(iBLLSession); }
/// <summary> /// 获取BLLSession /// </summary> /// <returns></returns> public IBLLSession GetBllSession() { IBLLSession bllSession = CallContext.GetData(typeof(BLLSessionFactory).Name) as BLLSession; if (bllSession == null) { bllSession = new BLLSession(); CallContext.SetData(typeof(BLLSessionFactory).Name, bllSession); } return(bllSession); }
public IBLLSession GetBLLSession() { //从当前线程中 获取 DBContext 数据仓储 对象 IBLLSession iBLLSession = System.Runtime.Remoting.Messaging.CallContext.GetData(typeof(BLLSessionFactory).Name) as IBLLSession; if (iBLLSession == null) { iBLLSession = new BLLSession(); System.Runtime.Remoting.Messaging.CallContext.SetData(typeof(BLLSessionFactory).Name, iBLLSession); } return(iBLLSession); }
private OperContext() { BLLSession = SpringHelper.GetObject <IBLLSession>("BLLSession"); }
private OperContext() { BllSession = new BLLSessionFactory().GetBLLSesson();// SpringHelper.GetObject<IBLLSession>("BLLSession"); }
public OperateContext() { BLLSession = DI.AutoFacHelper.GetObject<IBLLSession>("BLLSession"); }
public OperateContext() { bLLSession = DI.StringHelper.GetObject <IBLLSession>("BLLSession"); }
public OperateContext() { bllSession = SpringHelper.GetObject <IBLLSessionFactory>("BLLSessionFactory").GetBLLSession(); }