コード例 #1
0
        public async Task <IActionResult> Get([FromQuery] Guid environmentId = default)
        {
            var cmd    = new GetEnvironmentCommand(environmentId);
            var result = await _broker.Handle(cmd);

            if (result?.Content != null)
            {
                return(Ok(await result.Content.ReadAsStringAsync()));
            }

            return(Ok());
        }
コード例 #2
0
        /// <summary>
        /// Public constructor with DI
        /// </summary>
        /// <param name="serviceProvider"></param>
        /// <param name="globalEnvironment"></param>
        /// <param name="getEnvironmentCommand"></param>
        public CommandsController(IServiceProvider serviceProvider,
                                  CommerceEnvironment globalEnvironment,
                                  GetEnvironmentCommand getEnvironmentCommand,
                                  IConfiguration configuration) : base(serviceProvider, globalEnvironment)
        {
            _getEnvironmentCommand = getEnvironmentCommand;
            _serviceProvider       = serviceProvider;
            _globalEnvironment     = globalEnvironment;

            _connectionString = configuration.GetConnectionString("AppSettings:ServiceBusConnectionString");
            _topicName        = configuration.GetValue <string>("AppSettings:ServiceBusTopicName");
            _subscriptionName = configuration.GetValue <string>("AppSettings:ServiceBusSubscriptionName");
        }
コード例 #3
0
 public ServiceBusConsumer(
     CommerceCommander commerceCommander,
     GetEnvironmentCommand getEnvironmentCommand,
     ImportSellableItemFromContentHubCommand importSellableItemFromContentHubCommand,
     ImportCategoryFromContentHubCommand importCategoryFromContentHubCommand,
     IConfiguration configuration,
     ILogger <ServiceBusConsumer> logger,
     IServiceProvider serviceProvider,
     CommerceEnvironment globalEnvironment)
 {
     _serviceProvider       = serviceProvider;
     _globalEnvironment     = globalEnvironment;
     _getEnvironmentCommand = getEnvironmentCommand;
     _commerceCommander     = commerceCommander;
     _logger           = logger;
     _connectionString = configuration.GetConnectionString("AppSettings:ServiceBusConnectionString");
     _topicName        = configuration.GetValue <string>("AppSettings:ServiceBusTopicName");
     _queueClient      = new QueueClient(_connectionString, _topicName);
     this._nodeContext = serviceProvider.GetService <NodeContext>();
     _importSellableItemFromContentHubCommand = importSellableItemFromContentHubCommand;
     _importCategoryFromContentHubCommand     = importCategoryFromContentHubCommand;
 }
 public RunMinionNowCommand(IRunMinionPipeline runMinionPipeline, IServiceProvider serviceProvider, GetEnvironmentCommand getEnvironmentPipeline)
     : base(serviceProvider)
 {
     this._runMinionPipeline = runMinionPipeline;
     this._getEnvironment    = getEnvironmentPipeline;
 }
コード例 #5
0
 /// <summary>
 /// Public constructor with DI
 /// </summary>
 /// <param name="serviceProvider"></param>
 /// <param name="globalEnvironment"></param>
 /// <param name="getEnvironmentCommand"></param>
 public CommandsController(IServiceProvider serviceProvider, CommerceEnvironment globalEnvironment, GetEnvironmentCommand getEnvironmentCommand) : base(serviceProvider, globalEnvironment)
 {
     _getEnvironmentCommand = getEnvironmentCommand;
 }