예제 #1
0
        public IHttpActionResult Post([FromBody] FirmRegion region)
        {
            try
            {
                if (region == null)
                {
                    return(BadRequest());
                }



                var result = _repository.Insert(region);
                if (result.Status == RepositoryActionStatus.Created)
                {
                    // map to dto
                    return(Created <FirmRegion>(Request.RequestUri
                                                + "/" + region.Id.ToString(), region));
                }

                return(BadRequest());
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }