Esempio n. 1
0
 protected DACBase(string connectionString, ILogger logger = null)
 {
     ConnectionString = connectionString;
     Log                   = logger ?? new NoOpLogger();
     _artificialKeys       = null;
     DefaultIsolationLevel = IsolationLevel.ReadCommitted;
     UseScopeOsmosis       = true;
     InstanceID            = Guid.NewGuid();
 }
Esempio n. 2
0
        public DBSchema ApplyArtificialKeys(ArtificialKeys artificialKeys)
        {
            if (artificialKeys == null)
            {
                throw new ArgumentNullException("artificialKeys");
            }

            if (artificialKeys.Tables == null)
            {
                throw new ArgumentException("Artificial Keys did not contain any tables", "artificialKeys");
            }

            artificialKeys.ApplyToSchema(this);

            return(this);
        }
Esempio n. 3
0
 public DBSchema GetSchema()
 {
     using (var scope = this.BeginScope()) {
         var schema =
             new DBSchema {
             DatabaseID = this.ConnectionString,
             Tables     = NormalizeTables(GetDenormalizedTableDescriptions()),
             Triggers   = NormalizeTriggers(GetDenormalizedTriggerDescriptions()),
             SQL        = string.Empty
         };
         if (ArtificialKeys != null)
         {
             ArtificialKeys.ApplyToSchema(schema);
         }
         schema.FinishedBuilding();
         return(schema);
     }
 }