public IActionResult UpdateFile( long documentId, IList <IFormFile> files) { Stream stream = null; var command = new UpdateFileToDocumentCommand { DocumentId = documentId, }; if (files != null && files.Length() > 0) { var file = files[0]; stream = file.OpenReadStream(); command.File = stream; } return(updateFileCommandHandler.Execute(command) .Match(x => x.Match <IActionResult>(Ok, BadRequest), ex => StatusCode(500, ex))); }
ValidateFile(UpdateFileToDocumentCommand file) => from x in ValidateFieldNonNull(file, nameof(file)) from y in (