public async Task <IActionResult> UnpublishContent(Guid id) { var command = new UnpublishContent { ContentId = id }; await CommandBus.PublishAsync(command); return(NoContent()); }
public ContentDomainObject Unpublish(UnpublishContent command) { Guard.NotNull(command, nameof(command)); VerifyCreatedAndNotDeleted(); RaiseEvent(SimpleMapper.Map(command, new ContentUnpublished())); return(this); }
protected Task On(UnpublishContent command, CommandContext context) { return(handler.UpdateAsync <ContentDomainObject>(context, c => c.Unpublish(command))); }