public void CreateArticle(CreateArticleParam param) { var article = new Article(GuidHelper.GenerateComb().ToString(), param.Title, param.Content, DateTime.Now, (ArticleState)param.State, param.CategoryId, param.Tags); _articleDomainService.CreateArticle(article); _integrationEventBus.PublishEvent(new NewArticleCreatedEvent(article.Id, article.Title, article.Content, article.CreateDate, (ArticleDetailState)article.State, article.CategoryId, article.Tags)); }
public void CreateArticle(CreateArticleParam param) { var article = new Article(param.Id, param.Title, param.Content, DateTime.Now, (ArticleState)param.State, param.CategoryId, param.Tags); _articleDomainService.CreateArticle(article); _integrationEventBus.PublishEvent(new NewArticleCreatedEvent(article.Id, article.Title, article.Content, article.CreateDate, (NewArticleCreatedState)article.State, article.CategoryId, article.Tags)); }
public async Task PublishAsync(IntegrationEvent @event) { try { await MarkEventAsInProgressAsync(@event.Id); _eventBus.PublishEvent(@event); await MarkEventAsPublishedAsync(@event.Id); } catch (Exception ex) { await MarkEventAsFailedAsync(@event.Id); } }
public void IntegrationEventTest() { _integrationEventBus.PublishEvent(new AppleIntegrationEvent()); }