示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestScope"/> class.
        /// </summary>
        /// <param name="dataExchangeFactory">The data exchange factory.</param>
        /// <param name="session">The session.</param>
        /// <param name="statement">The statement</param>
        public RequestScope(
            DataExchangeFactory dataExchangeFactory,
            ISession session,
            IStatement statement
            )
        {
            errorContext = new ErrorContext();

            this.statement = statement;
            parameterMap = statement.ParameterMap;
            this.session = session;
            this.dataExchangeFactory = dataExchangeFactory;
            id = GetNextId();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestScope"/> class.
        /// </summary>
        /// <param name="dataExchangeFactory">The data exchange factory.</param>
        /// <param name="session">The session.</param>
        /// <param name="statement">The statement</param>
        public RequestScope(
            DataExchangeFactory dataExchangeFactory,
            ISession session,
            IStatement statement
            )
        {
            errorContext = new ErrorContext();

            this.statement = statement;//statement则包含了sql语句字符串和参数类信息
            parameterMap = statement.ParameterMap;
            this.session = session; //ISession对象是DataMapperSession类对象,其中包含了数据库的连接与事物类对象 
            this.dataExchangeFactory = dataExchangeFactory;
            id = GetNextId();
        }