// POST api/<controller> public async Task <IHttpActionResult> Post([FromBody] FileInfo fileInfo, CancellationToken cancellationToken = default(CancellationToken)) { try { var id = await _fileInfoManager.InsertFileInfoAsync(fileInfo, cancellationToken); return(Ok <long>(id)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }