Пример #1
0
        public async Task <IHttpActionResult> Post([FromBody] DestinationPointForm destinationPointAdded)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid posted data."));
            }

            try
            {
                var destinationPoint = _mapper.Map <DestinationPoint>(destinationPointAdded);
                var catalogName      = HttpUtility.UrlDecode(destinationPointAdded.CatalogName);
                var documentId       = HttpUtility.UrlDecode(destinationPointAdded.DocumentId);
                return(Ok(await _destinationService.AddDestinationPointAsync(catalogName, documentId, destinationPoint)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }
        }