internal Queue(InternalContext context, SetDataMap map) { ID = Guid.NewGuid(); Context = context; Map = map; CreateAt = DateTime.Now; }
/// <summary> /// 复制条件 /// </summary> /// <param name="queue">队列</param> internal void Copy(Queue queue) { ID = queue.ID; Context = queue.Context; _expBuilder = queue.ExpBuilder; queue.Dispose(); }
/// <summary> /// 初始化数据库环境(共享自其它上下文)、实例化子类中,所有Set属性 /// </summary> /// <param name="currentContextType">外部上下文类型</param> /// <param name="masterContext">其它上下文(主上下文)</param> public void TransactionInstance(Type currentContextType, InternalContext masterContext) { this.ContextType = currentContextType; this.IsUnitOfWork = masterContext.IsUnitOfWork; // 连接字符串 this.ContextConnection = masterContext.ContextConnection; // 手动编写SQL ManualSql = masterContext.ManualSql; // 默认SQL执行者 Executeor = masterContext.Executeor; // 数据库提供者 DbProvider = masterContext.DbProvider; // 队列管理者 QueueManger = masterContext.QueueManger; // 上下文映射关系 ContextMap = new ContextDataMap(ContextType); // 不再需要初始化 IsInitializer = true; }
/// <summary> /// 队列管理模块 /// </summary> /// <param name="provider">数据库上下文</param> internal QueueManger(InternalContext provider) { ContextProvider = provider; }
/// <summary> /// 将SQL发送到数据库 /// </summary> /// <param name="dataBase">数据库操作</param> /// <param name="contextProvider">数据库上下文</param> internal ExecuteSql(DbExecutor dataBase, InternalContext contextProvider) { DataBase = dataBase; _contextProvider = contextProvider; }