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); }
static void Main(string[] args) { IsolateMethodCalls = false; SQLiteBitMonitor.MonitorBitness(); PreInit(); AddValidArgument("t", true); DefaultMethod = typeof(Program).GetMethod("Start"); Initialize(args); }
/// <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(); }
static SQLiteDatabase() { SQLiteBitMonitor.MonitorBitness(); }
static SQLiteRegistrar() { SQLiteBitMonitor.MonitorBitness(); }