コード例 #1
0
        public async Task <ActionResult> Post(Permit entity)
        {
            try
            {
                await _service.Create(entity);

                await _service.SaveChanges();
            }
            catch (Exception)
            {
                return(BadRequest(new { entity = entity, message = "There was a problem adding the Permit" }));
            }

            return(Created("/permit", entity));
        }