Beispiel #1
0
        public SQLTriggerBinding(ParameterInfo parameter, INameResolver nameResolver,
                                 IChangeTracker changeTracker, SQLTriggerAttribute attribute)
        {
            if (parameter == null)
            {
                throw new ArgumentNullException(nameof(parameter));
            }
            if (nameResolver == null)
            {
                throw new ArgumentNullException(nameof(nameResolver));
            }
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }
            if (changeTracker == null)
            {
                throw new ArgumentNullException(nameof(changeTracker));
            }

            this._parameter     = parameter;
            this._nameResolver  = nameResolver;
            this._attribute     = attribute;
            this._changeTracker = changeTracker;
        }
Beispiel #2
0
        private int GetTriggerAttributePollingInSecs(SQLTriggerAttribute triggerAttribute)
        {
            var pollingInSecsString = _nameResolver.Resolve("SQLTrigger.PollingInSecs");
            int pollingInSecs       = 0;

            if (int.TryParse(pollingInSecsString, out pollingInSecs))
            {
                return(pollingInSecs);
            }

            return(triggerAttribute.PollingInSeconds);
        }
Beispiel #3
0
        private string GetTriggerAttributeConnectionString(SQLTriggerAttribute triggerAttribute)
        {
            if (string.IsNullOrEmpty(triggerAttribute.ConnectionString))
            {
                var connectionString = _nameResolver.Resolve("SQLTrigger.ConnectionString");

                if (string.IsNullOrEmpty(connectionString))
                {
                    throw new InvalidOperationException("ConnectionString is mandatory");
                }

                return(connectionString);
            }

            return(triggerAttribute.ConnectionString);
        }
Beispiel #4
0
        public SQLTriggerListener(ITriggeredFunctionExecutor executor,
                                  IChangeTracker changeTracker, SQLTriggerAttribute attribute)
        {
            if (executor == null)
            {
                throw new ArgumentNullException(nameof(executor));
            }
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }
            if (changeTracker == null)
            {
                throw new ArgumentNullException(nameof(changeTracker));
            }

            this._executor      = executor;
            this._changeTracker = changeTracker;
            this._attribute     = attribute;
        }