示例#1
0
        /// <summary>
        /// Integration event handler which starts the Catalog item delete event
        /// </summary>
        /// <param name="event"></param>
        /// <returns></returns>
        public async Task Handle(CatalogItemDeleteIntegrationEvent @event)
        {
            if (@event.RequestId != Guid.Empty)
            {
                var deleteCatalogItemCommand = new DeleteCatalogItemCommand(@event.Id);

                var requestDeleteCatalogItem = new IdentifiedCommand <DeleteCatalogItemCommand, int>(deleteCatalogItemCommand, @event.RequestId);

                var result = await _mediator.Send(requestDeleteCatalogItem);
            }

            _logger.CreateLogger(nameof(CatalogItemUpdateIntegrationEventHandler))
            .LogTrace(false ? $"CatalogItemDelete integration event has been received and a create new order process is started with requestId: {@event.RequestId}" :
                      $"CatalogItemDelete integration event has been received but a new order process has failed with requestId: {@event.RequestId}");
        }
 public async Task <IActionResult> DeleteCatalogItemAsync(DeleteCatalogItemCommand command)
 {
     return(Ok(await _mediator.Send(command)));
 }