Class OleDbSqlServerDataSource.
Inheritance: OleDbSqlServerDataSourceBase, IRootDataSource
Esempio n. 1
0
 public OleDbSqlServerDataSource AttachRules(OleDbSqlServerDataSource 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)
         );
 }
Esempio n. 2
0
        static TestBase()
        {

            foreach (ConnectionStringSettings con in ConfigurationManager.ConnectionStrings)
            {
                var ds = new OleDbSqlServerDataSource(con.Name, con.ConnectionString);
                s_DataSources.Add(con.Name, ds);
                if (s_PrimaryDataSource == null) s_PrimaryDataSource = ds;
            }



        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new data source with the indicated changes to the settings.
        /// </summary>
        /// <param name="settings">The new settings to use.</param>
        /// <returns></returns>
        /// <remarks>The new data source will share the same database metadata cache.</remarks>
        public OleDbSqlServerDataSource WithSettings(SqlServerDataSourceSettings?settings)
        {
            var mergedSettings = new SqlServerDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents  = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode            = settings?.StrictMode ?? StrictMode,
                XactAbort             = settings?.XactAbort ?? XactAbort,
                ArithAbort            = settings?.ArithAbort ?? ArithAbort
            };
            var result = new OleDbSqlServerDataSource(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);
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a new data source with the indicated changes to the settings.
        /// </summary>
        /// <param name="settings">The new settings to use.</param>
        /// <returns></returns>
        /// <remarks>The new data source will share the same database metadata cache.</remarks>
        public OleDbSqlServerDataSource WithSettings(SqlServerDataSourceSettings settings)
        {
            var mergedSettings = new SqlServerDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode = settings?.StrictMode ?? StrictMode,
                XactAbort = settings?.XactAbort ?? XactAbort,
                ArithAbort = settings?.ArithAbort ?? ArithAbort
            };
            var result = new OleDbSqlServerDataSource(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;
        }