Пример #1
0
        public async Task <IActionResult> UnpublishContent(Guid id)
        {
            var command = new UnpublishContent {
                ContentId = id
            };

            await CommandBus.PublishAsync(command);

            return(NoContent());
        }
Пример #2
0
        public ContentDomainObject Unpublish(UnpublishContent command)
        {
            Guard.NotNull(command, nameof(command));

            VerifyCreatedAndNotDeleted();

            RaiseEvent(SimpleMapper.Map(command, new ContentUnpublished()));

            return(this);
        }
Пример #3
0
 protected Task On(UnpublishContent command, CommandContext context)
 {
     return(handler.UpdateAsync <ContentDomainObject>(context, c => c.Unpublish(command)));
 }