public async Task <IActionResult> Post(CreateCustomer command) { var context = GetContext(command.Id); await BusPublisher.SendAsync(command, context); return(Accepted()); }
public async Task <IActionResult> Post(CreateLocationCommand locationCommand) { var context = GetContext(locationCommand.commandId); await BusPublisher.SendAsync(locationCommand, context); return(Accepted()); }
public async Task <IActionResult> Post(AddProductToBasket command) { var context = GetContext(); await BusPublisher.SendAsync(command, context); return(Accepted()); }
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)); }
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)); }
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); }); }