GetSqlProgram() private method

private GetSqlProgram ( [ name, Type>.[ parameters = null, bool ignoreValidationErrors = null, bool checkOrder = null, System.TimeSpan defaultCommandTimeout = null, TypeConstraintMode constraintMode = null, CancellationToken cancellationToken = default(CancellationToken) ) : Task
name [
parameters Type>.[
ignoreValidationErrors bool
checkOrder bool
defaultCommandTimeout System.TimeSpan
constraintMode TypeConstraintMode
cancellationToken System.Threading.CancellationToken
return Task
コード例 #1
0
        public Task <SqlProgram> GetSqlProgram(
            [NotNull] string database,
            [NotNull] string name,
            [CanBeNull] IEnumerable <KeyValuePair <string, Type> > parameters = null,
            bool ignoreValidationErrors         = false,
            bool checkOrder                     = false,
            TimeSpan?defaultCommandTimeout      = null,
            TypeConstraintMode?constraintMode   = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (database == null)
            {
                throw new ArgumentNullException("database");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            // We have to find the database otherwise we cannot get a load balanced connection.
            DatabaseElement db = Databases[database];

            if ((db == null) ||
                (!db.Enabled))
            {
                return(TaskResult <SqlProgram> .FromException(
                           new LoggingException(
                               () => Resources.DatabaseConfiguration_GetSqlProgram_DatabaseIdNotFound,
                               database)));
            }

            return(db.GetSqlProgram(
                       name,
                       parameters,
                       ignoreValidationErrors,
                       checkOrder,
                       defaultCommandTimeout,
                       constraintMode,
                       cancellationToken));
        }