public async Task<ActionResult> Publish() { if (this._conference == null) { return HttpNotFound(); } var command = new PublishConference { AggregateRootId = this._conference.Id }; var result = await ExecuteCommandAsync(command); if (!result.IsSuccess()) { throw new InvalidOperationException(result.GetErrorMessage()); } return RedirectToAction("Index", new { slug = this._conference.Slug, accessCode = this._conference.AccessCode }); }
public async Task HandleAsync(ICommandContext context, PublishConference command) { var conference = await context.GetAsync <Conference>(command.AggregateRootId); conference.Publish(); }
public void Handle(ICommandContext context, PublishConference command) { context.Get <Conference>(command.AggregateRootId).Publish(); }