Esempio n. 1
0
 /// <summary>
 /// Creates a new instance of DoDataaOperations
 /// </summary>
 /// <param name="ConnectionString"></param>
 public DoDataOperations(string ConnectionString, IDoManagerSettings Settings, IContainer IoCContainer)
 {
     this.connectionString = ConnectionString;
     this.context          = new FirebirdContext(this.connectionString);
     _settings             = Settings;
     Container             = IoCContainer;
 }
Esempio n. 2
0
 private int GetDbVersion()
 {
     using (var context = new FirebirdContext(this.connectionString))
     {
         int dbVersion = 0;
         try
         {
             dbVersion = context.DbVersion.Max(d => d.Version);
         }
         catch (System.Data.Entity.Core.EntityCommandExecutionException e)
         {
             Log.Error().WriteLine(e.InnerException.ToString());
             if (e.InnerException.ToString().Contains("DBVERSION"))
             {
                 context.Database.ExecuteSqlCommand("CREATE TABLE DBVERSION (DBVERSION int, DESCRIPTION varchar(256))");
                 context.SaveChanges();
                 context.DbVersion.Add(new DbVersionModel() { Version = 1, Descripiton = "Inital Db Version with version table" });
                 context.SaveChanges();
                 Log.Info().WriteLine("Created Table DBVERSION");
                 UpgradeDb();
             }
         }
         Log.Info().WriteLine("DB version is {0}", dbVersion.ToString());
         return dbVersion;
     }
 }
Esempio n. 3
0
 public DoDataOperations()
 {
     this.context = new FirebirdContext();
 }
Esempio n. 4
0
 public DbMigrator(string ConnectionString)
 {
     this.context = new FirebirdContext(ConnectionString);
     this.connectionString = ConnectionString;
 }
Esempio n. 5
0
 public DoDataOperations()
 {
     this.context = new FirebirdContext();
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a new instance of DoDataaOperations
 /// </summary>
 /// <param name="ConnectionString"></param>
 public DoDataOperations(string ConnectionString, IContainer IoCContainer)
 {
     this.connectionString = ConnectionString;
     this.context = new FirebirdContext(this.connectionString);
     Container = IoCContainer;
 }