예제 #1
0
        public async Task <IActionResult> PostUpsertAsset(string app, DomainId id, UpsertAssetDto request)
        {
            var command = request.ToCommand(id, await CheckAssetFileAsync(request.File));

            var response = await InvokeCommandAsync(command);

            return(Ok(response));
        }
예제 #2
0
        public async Task <IActionResult> PostAssetTus(string app)
        {
            var url = Url.Action(null, new { app, fileId = (object?)null }) !;

            var(result, file) = await assetTusRunner.InvokeAsync(HttpContext, url);

            if (file != null)
            {
                var command = UpsertAssetDto.ToCommand(file);

                var response = await InvokeCommandAsync(command);

                return(CreatedAtAction(nameof(GetAsset), new { app, id = response.Id }, response));
            }

            return(result);
        }