Пример #1
0
        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 });
        }
Пример #2
0
        public async Task HandleAsync(ICommandContext context, PublishConference command)
        {
            var conference = await context.GetAsync <Conference>(command.AggregateRootId);

            conference.Publish();
        }
Пример #3
0
 public void Handle(ICommandContext context, PublishConference command)
 {
     context.Get <Conference>(command.AggregateRootId).Publish();
 }