public async Task <IActionResult> PostAsync([FromForm] SourcePointForm sourcePointAdded) { if (!ModelState.IsValid) { return(BadRequest("Invalid posted data.")); } try { var sourcePoint = _mapper.Map <SourcePoint>(sourcePointAdded); var catalogName = HttpUtility.UrlDecode(sourcePointAdded.CatalogName); var documentId = HttpUtility.UrlDecode(sourcePointAdded.DocumentId); return(Ok(await _sourceService.AddSourcePoint(catalogName, documentId, sourcePoint))); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }