Ejemplo 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;
 }
Ejemplo 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;
     }
 }
Ejemplo n.º 3
0
 public DoDataOperations()
 {
     this.context = new FirebirdContext();
 }
Ejemplo n.º 4
0
 public DbMigrator(string ConnectionString)
 {
     this.context = new FirebirdContext(ConnectionString);
     this.connectionString = ConnectionString;
 }
Ejemplo n.º 5
0
 public DoDataOperations()
 {
     this.context = new FirebirdContext();
 }
Ejemplo 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;
 }