Exemplo n.º 1
0
        public async Task <ActionResult <Adult> > AddAdult(Adult adult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                await _fileStorage.AddAdult(adult);

                await _adultRepo.CreateAdultAsync(adult);

                return(Ok());
            }
            catch (Exception e)
            {
                return(StatusCode(500, "Internal server error"));
            }
        }