예제 #1
0
        /// <summary>
        /// 随机的数据源路径,初始化一个 <see cref="Aoite.Data.MsCeTestManager"/> 类的新实例。
        /// </summary>
        /// <param name="databasePath">数据源路径。</param>
        public MsCeTestManager(string databasePath)
        {
            if(string.IsNullOrWhiteSpace(databasePath)) throw new ArgumentNullException(nameof(databasePath));
            this.DatabasePath = databasePath;
            GA.IO.CreateDirectory(Path.GetDirectoryName(databasePath));
            var provider = new SqlCeEngineProvider(this.DatabasePath, null);
            provider.CreateDatabase();
            var engine = new DbEngine(provider);
            this.Engine = engine;
            this.Engine.Executing += _Engine_Executing;

        }
예제 #2
0
        /// <summary>
        /// 随机的数据源路径,初始化一个 <see cref="Aoite.Data.MsCeTestManager"/> 类的新实例。
        /// </summary>
        /// <param name="databasePath">数据源路径。</param>
        public MsCeTestManager(string databasePath)
        {
            if (string.IsNullOrWhiteSpace(databasePath))
            {
                throw new ArgumentNullException(nameof(databasePath));
            }
            this.DatabasePath = databasePath;
            GA.IO.CreateDirectory(Path.GetDirectoryName(databasePath));
            var provider = new SqlCeEngineProvider(this.DatabasePath, null);

            provider.CreateDatabase();
            var engine = new DbEngine(provider);

            this.Engine            = engine;
            this.Engine.Executing += _Engine_Executing;
        }