コード例 #1
0
ファイル: Edit.cshtml.cs プロジェクト: Aleksey-M/RiseDiary
        public async Task OnPostSaveUpdatedAsNewImageAsync(Guid imageId, Guid?recordId)
        {
            RecordId = recordId;
            var newImageId = await _imagesEditService.CreateNewImageFromChanged(imageId);

            if (RecordId != null && RecordId.Value != Guid.Empty)
            {
                await _recordImagesService.AddRecordImage(RecordId.Value, newImageId);
            }
            await UpdateModel(newImageId);
        }
コード例 #2
0
        public async Task <ActionResult <Guid> > SaveChangesAsNewImage(Guid imageId)
        {
            try
            {
                var newImageId = await _imagesEditService.CreateNewImageFromChanged(imageId);

                return(Ok(newImageId));
            }
            catch (ArgumentException exc)
            {
                return(BadRequest(exc.Message));
            }
        }