コード例 #1
0
        public async Task <ActionResult <Adult> > AddAnAdult([FromBody] Adult adult)
        {
            try
            {
                await adultRepo.AddAnAdult(adult);

                return(Created($"/{adult.Id}", adult));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(StatusCode(500, e.Message));
            }
        }