public async Task <ActionResult <HostedFile> > CreateHostedFile(int id, [FromBody] HostedFile file) { try { HostedFile hostedFile = await _service.CreateHostedFile(file); return(CreatedAtRoute(nameof(GetHostedFile), new { id = id, hfid = file.Id }, hostedFile)); } catch (ControllerNotFoundException e) { return(NotFound(e.Message)); } catch (ControllerBadRequestException e) { return(BadRequest(e.Message)); } }