public async Task <IActionResult> PostImageForAnalysis(IFormFile image) { Stream stream = image.OpenReadStream(); string name = image.FileName; string uri = await _imageStorage.UploadFile(stream); ImageAnalysisRequest imageAnalysisRequest = new ImageAnalysisRequest() { Id = Guid.NewGuid(), SenderDevice = name, URL = uri, Processed = false }; imageAnalysisRequest.Events.Add(new QueueImageForAnalysisEvent(imageAnalysisRequest)); _repository.Add(imageAnalysisRequest); return(CreatedAtAction("StartNewImageAnalysisRequest", new { id = imageAnalysisRequest.Id, url = uri })); }