コード例 #1
0
        public async Task <IActionResult> Post(CreateCustomer command)
        {
            var context = GetContext(command.Id);
            await BusPublisher.SendAsync(command, context);

            return(Accepted());
        }
コード例 #2
0
        public async Task <IActionResult> Post(CreateLocationCommand locationCommand)
        {
            var context = GetContext(locationCommand.commandId);
            await BusPublisher.SendAsync(locationCommand, context);

            return(Accepted());
        }
コード例 #3
0
        public async Task <IActionResult> Post(AddProductToBasket command)
        {
            var context = GetContext();
            await BusPublisher.SendAsync(command, context);

            return(Accepted());
        }
コード例 #4
0
        protected async Task <IActionResult> SendAsync <T, TResourceType>(T command,
                                                                          TResourceType resourceId = default(TResourceType), string resource = "") where T : ICommand
        {
            var resId   = GetContextResourceId(resourceId);
            var context = GetContext <T>(resId, resource);
            await BusPublisher.SendAsync(command, context);

            return(Accepted(context));
        }
コード例 #5
0
        protected async Task <IActionResult> SendAsync <TCommand, TResourceType>(TCommand command,
                                                                                 [AllowNull] TResourceType resourceId, string resource = "")
            where TCommand : ICommand

        {
            var resId   = GetContextResourceId(resourceId);
            var context = GetContext <TCommand>(resId, resource);
            await BusPublisher.SendAsync(command, context);

            return(Accepted(context));
        }
コード例 #6
0
        public override async Task HandleAsync(CreateDefaultsSettings command, ICorrelationContext context)
        {
            DefaultsSettings.Get.ForEach(async s =>
            {
                Setting setting = Mapper.Map <Setting>(s);

                CreateSetting cmd = Mapper.Map <CreateSetting>(setting);

                await BusPublisher.SendAsync(cmd, context);
            });
        }