public TasklingClient(IConfigurationReader configurationReader,
                              CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
            {
                customDependencies.TaskRepository = new TaskRepository();
            }

            if (customDependencies.Configuration == null)
            {
                _configuration = new TasklingConfiguration(configurationReader);
            }

            if (customDependencies.CommonTokenRepository == null)
            {
                customDependencies.CommonTokenRepository = new CommonTokenRepository();
            }

            if (customDependencies.ExecutionTokenRepository == null)
            {
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);
            }

            if (customDependencies.EventsRepository == null)
            {
                customDependencies.EventsRepository = new EventsRepository();
            }

            if (customDependencies.TaskExecutionRepository != null)
            {
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            }
            else
            {
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);
            }

            if (customDependencies.CriticalSectionRepository != null)
            {
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            }
            else
            {
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);
            }

            if (customDependencies.BlockRepository == null)
            {
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.RangeBlockRepository != null)
            {
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            }
            else
            {
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ListBlockRepository != null)
            {
                _listBlockRepository = customDependencies.ListBlockRepository;
            }
            else
            {
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ObjectBlockRepository != null)
            {
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            }
            else
            {
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.BlockFactory != null)
            {
                _blockFactory = customDependencies.BlockFactory;
            }
            else
            {
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);
            }

            if (customDependencies.CleanUpRepository == null)
            {
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.CleanUpService != null)
            {
                _cleanUpService = customDependencies.CleanUpService;
            }
            else
            {
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
            }
        }
        public TasklingClient(IConfigurationReader configurationReader,
            CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
                customDependencies.TaskRepository = new TaskRepository();

            if (customDependencies.Configuration == null)
                _configuration = new TasklingConfiguration(configurationReader);

            if (customDependencies.CommonTokenRepository == null)
                customDependencies.CommonTokenRepository = new CommonTokenRepository();

            if (customDependencies.ExecutionTokenRepository == null)
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);

            if (customDependencies.EventsRepository == null)
                customDependencies.EventsRepository = new EventsRepository();

            if (customDependencies.TaskExecutionRepository != null)
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            else
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);

            if (customDependencies.CriticalSectionRepository != null)
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            else
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);

            if (customDependencies.BlockRepository == null)
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);

            if (customDependencies.RangeBlockRepository != null)
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            else
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ListBlockRepository != null)
                _listBlockRepository = customDependencies.ListBlockRepository;
            else
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ObjectBlockRepository != null)
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            else
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.BlockFactory != null)
                _blockFactory = customDependencies.BlockFactory;
            else
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);

            if (customDependencies.CleanUpRepository == null)
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);

            if (customDependencies.CleanUpService != null)
                _cleanUpService = customDependencies.CleanUpService;
            else
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
        }