コード例 #1
0
ファイル: TestProgram.cs プロジェクト: ThreeHeadz/Bam.Net
        public static void DaoExpressionFilterTest()
        {
            SQLiteBitMonitor.MonitorBitness();
            Database      database = new SQLiteDatabase(".\\", MethodBase.GetCurrentMethod().Name);
            ConsoleLogger logger   = PrepareDatabaseAndGetLogger(database);

            TestTable testInstance = new TestTable();

            testInstance.Name = "banana";
            testInstance.Save(database);

            DaoExpressionFilter v          = new DaoExpressionFilter(logger);
            QueryFilter         testFilter = v.Where <TestTable>((t) => t.Name == testInstance.Name);

            TestTable check = TestTable.Where(Filter.Column("Name") == "banana", database).FirstOrDefault();

            Expect.IsNotNull(check);

            TestTable evalCheck = TestTable.Where(testFilter, database).FirstOrDefault();

            Expect.IsNotNull(evalCheck);

            Expect.AreEqual(check.Id, evalCheck.Id);
            Out(v.TraceLog, ConsoleColor.Cyan);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ThreeHeadz/Bam.Net
        static void Main(string[] args)
        {
            IsolateMethodCalls = false;
            SQLiteBitMonitor.MonitorBitness();
            PreInit();

            AddValidArgument("t", true);
            DefaultMethod = typeof(Program).GetMethod("Start");

            Initialize(args);
        }
コード例 #3
0
        /// <summary>
        /// Instantiate a new SQLiteDatabase instance where the database
        /// file will be placed into the specified directoryPath using the
        /// specified connectionName as the file name
        /// </summary>
        /// <param name="directoryPath"></param>
        /// <param name="connectionName"></param>
        public SQLiteDatabase(string directoryPath, string connectionName)
            : base()
        {
            SQLiteBitMonitor.MonitorBitness();
            DirectoryInfo directory = new DirectoryInfo(directoryPath);

            if (!directory.Exists)
            {
                directory.Create();
            }
            ConnectionStringResolver = new SQLiteConnectionStringResolver
            {
                Directory = directory
            };

            ConnectionName  = connectionName;
            ServiceProvider = new Incubator();
            ServiceProvider.Set <DbProviderFactory>(SQLiteFactory.Instance);
            Register();
        }
コード例 #4
0
 static SQLiteDatabase()
 {
     SQLiteBitMonitor.MonitorBitness();
 }
コード例 #5
0
ファイル: SQLiteRegistrar.cs プロジェクト: ThreeHeadz/Bam.Net
 static SQLiteRegistrar()
 {
     SQLiteBitMonitor.MonitorBitness();
 }