Class that represents a Access Data Source.
Inheritance: AccessDataSourceBase, IRootDataSource
Exemple #1
0
 static TestBase()
 {
     Setup.AssemblyInit();
     foreach (ConnectionStringSettings con in ConfigurationManager.ConnectionStrings)
     {
         var ds = new AccessDataSource(con.Name, con.ConnectionString);
         s_DataSources.Add(con.Name, ds);
         if (s_PrimaryDataSource == null) s_PrimaryDataSource = ds;
     }
 }
Exemple #2
0
 public AccessDataSource AttachRules(AccessDataSource source)
 {
     return source.WithRules(
         new DateTimeRule("CreatedDate", DateTimeKind.Local, OperationTypes.Insert),
         new DateTimeRule("UpdatedDate", DateTimeKind.Local, OperationTypes.InsertOrUpdate),
         new UserDataRule("CreatedByKey", "EmployeeKey", OperationTypes.Insert),
         new UserDataRule("UpdatedByKey", "EmployeeKey", OperationTypes.InsertOrUpdate),
         new ValidateWithValidatable(OperationTypes.InsertOrUpdate)
         );
 }
Exemple #3
0
        public AccessDataSource WithSettings(AccessDataSourceSettings settings)
        {
            var mergedSettings = new AccessDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents  = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode            = settings?.StrictMode ?? StrictMode
            };
            var result = new AccessDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache);

            result.m_DatabaseMetadata = m_DatabaseMetadata;
            result.AuditRules         = AuditRules;
            result.UserValue          = UserValue;

            result.ExecutionStarted  += (sender, e) => OnExecutionStarted(e);
            result.ExecutionFinished += (sender, e) => OnExecutionFinished(e);
            result.ExecutionError    += (sender, e) => OnExecutionError(e);
            result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e);

            return(result);
        }
Exemple #4
0
        public AccessDataSource WithSettings(AccessDataSourceSettings settings)
        {
            var mergedSettings = new AccessDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode = settings?.StrictMode ?? StrictMode
            };
            var result = new AccessDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache);
            result.m_DatabaseMetadata = m_DatabaseMetadata;
            result.AuditRules = AuditRules;
            result.UserValue = UserValue;

            result.ExecutionStarted += (sender, e) => OnExecutionStarted(e);
            result.ExecutionFinished += (sender, e) => OnExecutionFinished(e);
            result.ExecutionError += (sender, e) => OnExecutionError(e);
            result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e);

            return result;
        }