public async Task <JsonResult> Get(int pageVersionBlockId, PageVersionRegionBlocksActionDataType dataType = PageVersionRegionBlocksActionDataType.RenderDetails) { if (dataType == PageVersionRegionBlocksActionDataType.UpdateCommand) { var updateCommandQuery = new GetPatchableCommandByIdQuery <UpdatePageVersionBlockCommand>(pageVersionBlockId); return(await _apiResponseHelper.RunQueryAsync(updateCommandQuery)); } var query = new GetPageVersionBlockRenderDetailsByIdQuery() { PageVersionBlockId = pageVersionBlockId, PublishStatus = PublishStatusQuery.Latest }; return(await _apiResponseHelper.RunQueryAsync(query)); }
public async Task <IActionResult> Get(int pageVersionBlockId, PageVersionRegionBlocksActionDataType dataType = PageVersionRegionBlocksActionDataType.RenderDetails) { if (dataType == PageVersionRegionBlocksActionDataType.UpdateCommand) { var updateCommandQuery = new GetUpdateCommandByIdQuery <UpdatePageVersionBlockCommand>(pageVersionBlockId); var updateCommandResult = await _queryExecutor.ExecuteAsync(updateCommandQuery); return(_apiResponseHelper.SimpleQueryResponse(this, updateCommandResult)); } var query = new GetPageVersionBlockRenderDetailsByIdQuery() { PageVersionBlockId = pageVersionBlockId, PublishStatus = PublishStatusQuery.Latest }; var results = await _queryExecutor.ExecuteAsync(query); return(_apiResponseHelper.SimpleQueryResponse(this, results)); }
public IDomainRepositoryQueryContext <PageVersionBlockRenderDetails> AsRenderDetails(PublishStatusQuery?publishStatusQuery = null) { var query = new GetPageVersionBlockRenderDetailsByIdQuery(_pageVersionBlockId, publishStatusQuery); return(DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository)); }