public IDecorationCommandImplementation Get(IDataManipulationCommand command)
        {
            if (command is ILoadCommand)
                return new BulkLoadCommand(command as ILoadCommand);
            if (command is IResetCommand)
                return new TruncateCommand(command as IResetCommand);

            throw new ArgumentException();
        }
        public IDecorationCommandImplementation Get(IDataManipulationCommand command, IDbConnection connection)
        {
            if (!(connection is SqlConnection) || connection == null)
                throw new ArgumentException("connection");

            if (command is ILoadCommand)
                return new BulkLoadCommand(command as ILoadCommand, connection as SqlConnection);
            if (command is IResetCommand)
                return new TruncateCommand(command as IResetCommand, connection as SqlConnection);

            throw new ArgumentException();
        }
        public IDecorationCommandImplementation Get(IDataManipulationCommand command)
        {
            if (command is ILoadCommand)
            {
                return(new BulkLoadCommand(command as ILoadCommand));
            }
            if (command is IResetCommand)
            {
                return(new TruncateCommand(command as IResetCommand));
            }

            throw new ArgumentException();
        }
        public IDecorationCommandImplementation Get(IDataManipulationCommand command)
        {
            var connectionFactory = new ConnectionFactory();
            var connection = connectionFactory.Get(command.ConnectionString);
            IDataManipulationFactory factory = null;

            if (connection is SqlConnection)
                factory = new SqlServerDataManipulationFactory();

            if (factory != null)
                return factory.Get(command, connection);

            throw new ArgumentException();
        }
        public IDecorationCommandImplementation Get(IDataManipulationCommand command, IDbConnection connection)
        {
            if (!(connection is SqlConnection) || connection == null)
            {
                throw new ArgumentException("connection");
            }

            if (command is ILoadCommand)
            {
                return(new BulkLoadCommand(command as ILoadCommand, connection as SqlConnection));
            }
            if (command is IResetCommand)
            {
                return(new TruncateCommand(command as IResetCommand, connection as SqlConnection));
            }

            throw new ArgumentException();
        }
Beispiel #6
0
        public IDecorationCommandImplementation Get(IDataManipulationCommand command)
        {
            var connectionFactory            = new ConnectionFactory();
            var connection                   = connectionFactory.Get(command.ConnectionString);
            IDataManipulationFactory factory = null;

            if (connection is SqlConnection)
            {
                factory = new SqlServerDataManipulationFactory();
            }

            if (factory != null)
            {
                return(factory.Get(command));
            }

            throw new ArgumentException();
        }
Beispiel #7
0
        public IDecorationCommandImplementation Get(IDataManipulationCommand command)
        {
            var sessionFactory = new ClientProvider();
            var connection     = sessionFactory.Instantiate(command.ConnectionString).CreateNew() as IDbConnection;
            IDataManipulationFactory factory = null;

            if (connection is SqlConnection)
            {
                factory = new SqlServerDataManipulationFactory();
            }

            if (factory != null)
            {
                return(factory.Get(command, connection));
            }

            throw new ArgumentException();
        }