Ejemplo n.º 1
0
        public async Task <ActionResult <Hall> > Post([FromBody] Hall hall)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                _repository.Create(hall);

                await _repository.SaveChangesAsync();

                return(Ok(hall));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }