Esempio n. 1
0
        private void AddParametersFor(ICollectSqlParameters collector, List <ISqlParameter> toAddTo)
        {
            if (State == ParameterManagerLifecycleState.Finalized)
            {
                throw new InvalidOperationException("Cannot add new " + collector.GetType().Name + " level parameters because state is " + State);
            }

            State = ParameterManagerLifecycleState.ParameterDiscovery;

            toAddTo.AddRange(collector.GetAllParameters());
        }
Esempio n. 2
0
        public ParameterCollectionUIOptions(string useCase, ICollectSqlParameters collector, ParameterLevel currentLevel, ParameterManager parameterManager, CreateNewSqlParameterHandler createNewParameterDelegate = null)
        {
            UseCase                     = useCase;
            Collector                   = collector;
            CurrentLevel                = currentLevel;
            ParameterManager            = parameterManager;
            _createNewParameterDelegate = createNewParameterDelegate;

            if (_createNewParameterDelegate == null)
            {
                if (AnyTableSqlParameter.IsSupportedType(collector.GetType()))
                {
                    _createNewParameterDelegate = CreateNewParameterDefaultImplementation;
                }
            }
        }