public IHttpActionResult Put(int id, [FromBody] MappingOriginViewModel mappingOrigin)
        {
            try
            {
                if (mappingOrigin == null)
                {
                    return(BadRequest("MappingOrigin cannot be null"));
                }

                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }
                var updatedMappingOrigin = _repository.Update(Mapper.Map <MappingOrigin>(mappingOrigin));
                if (updatedMappingOrigin == null)
                {
                    return(NotFound());
                }
                return(Ok(updatedMappingOrigin));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
        public IHttpActionResult Post([FromBody] MappingOriginViewModel mappingOrigin)
        {
            try
            {
                if (mappingOrigin == null)
                {
                    return(BadRequest("MappingOrigin cannot be null"));
                }
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                var newMappingOrigin = _repository.Add(Mapper.Map <MappingOrigin>(mappingOrigin));

                if (newMappingOrigin == null)
                {
                    return(Conflict());
                }
                return(Created(Request.RequestUri + newMappingOrigin.Id.ToString(), Mapper.Map <MappingOriginViewModel>(newMappingOrigin)));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }