public async Task <JsonResult> Get(int customEntityVersionPageBlockId, CustomEntityVersionPageBlocksActionDataType dataType = CustomEntityVersionPageBlocksActionDataType.RenderDetails)
        {
            if (dataType == CustomEntityVersionPageBlocksActionDataType.UpdateCommand)
            {
                var updateCommandQuery = new GetPatchableCommandByIdQuery <UpdateCustomEntityVersionPageBlockCommand>(customEntityVersionPageBlockId);
                return(await _apiResponseHelper.RunQueryAsync(updateCommandQuery));
            }

            var query = new GetCustomEntityVersionPageBlockRenderDetailsByIdQuery()
            {
                CustomEntityVersionPageBlockId = customEntityVersionPageBlockId, PublishStatus = PublishStatusQuery.Latest
            };

            return(await _apiResponseHelper.RunQueryAsync(query));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Get(int customEntityVersionPageBlockId, CustomEntityVersionPageBlocksActionDataType dataType = CustomEntityVersionPageBlocksActionDataType.RenderDetails)
        {
            if (dataType == CustomEntityVersionPageBlocksActionDataType.UpdateCommand)
            {
                var updateCommandQuery  = new GetUpdateCommandByIdQuery <UpdateCustomEntityVersionPageBlockCommand>(customEntityVersionPageBlockId);
                var updateCommandResult = await _queryExecutor.ExecuteAsync(updateCommandQuery);

                return(_apiResponseHelper.SimpleQueryResponse(this, updateCommandResult));
            }

            var query = new GetCustomEntityVersionPageBlockRenderDetailsByIdQuery()
            {
                CustomEntityVersionPageBlockId = customEntityVersionPageBlockId, PublishStatus = PublishStatusQuery.Latest
            };
            var results = await _queryExecutor.ExecuteAsync(query);

            return(_apiResponseHelper.SimpleQueryResponse(this, results));
        }