static void Main(string[] args) { const string connectionStringPath = @"\\psf\Home\Dropbox\Dox\Mac-Git\connectionString.txt"; string connectionString = ConnectionStringReader.GetConnectionString(connectionStringPath); var dbFactory = new OrmLiteConnectionFactory(connectionString, MySqlDialectProvider.Instance); ISqlProvider customProvider = new MySqlProvider(); using (var db = dbFactory.OpenDbConnection()) { db.UpdateTable <Customer>(customProvider, true); var x = db.GetLastSql(); Console.ReadKey(); } }
public void Init() { const string connectionStringPath = @"\\psf\Home\Dropbox\Dox\Mac-Git\connectionString.txt"; connectionString_ = ConnectionStringReader.GetConnectionString(connectionStringPath); var dbFactory = new OrmLiteConnectionFactory(connectionString_, OrmLiteDialectProvider); using (var db = dbFactory.OpenDbConnection()) { db.ExecuteSql(CustomProvider.CreateSmallTestClass); db.ExecuteSql(CustomProvider.CreateBigTestClass); db.ExecuteSql(CustomProvider.CreateTestClassWithFk); db.ExecuteSql(CustomProvider.CreateTestClassWithOutFk); db.ExecuteSql(CustomProvider.CreateTestClassWithNotNullInt); db.ExecuteSql(CustomProvider.CreateTestClassFromIntToDouble); db.ExecuteSql(CustomProvider.CreateTestClassWithNullDouble); db.ExecuteSql(CustomProvider.CreateTestClassWithoutAutoIncrementId); } }
public AnchiDbContext() : this(ConnectionStringReader.GetConnectionString("AnchiERP")) { }