public async Task <IActionResult> PostContents(string app, string name, [FromBody] ImportContentsDto request)
        {
            var command = request.ToCommand();

            var context = await CommandBus.PublishAsync(command);

            var result   = context.Result <BulkUpdateResult>();
            var response = result.Select(x => BulkResultDto.FromImportResult(x, HttpContext)).ToArray();

            return(Ok(response));
        }
Example #2
0
        public async Task <IActionResult> PostContent(string app, string name, [FromBody] ImportContentsDto request)
        {
            await contentQuery.GetSchemaOrThrowAsync(Context, name);

            var command = request.ToCommand();

            var context = await CommandBus.PublishAsync(command);

            var result   = context.Result <ImportResult>();
            var response = result.Select(x => ImportResultDto.FromImportResult(x, HttpContext)).ToArray();

            return(Ok(response));
        }