public IActionResult GetTipoEvento(int tipoEventoId) { if (!_tipoEventoRepository.TipoEventoExists(tipoEventoId)) { return(NotFound()); } var tipoeventi = _tipoEventoRepository.GetTipoEvento(tipoEventoId); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var tipoEventoDto = new TipoEventoDto() { TipoEventoId = tipoeventi.TipoEventoId, NomeTipoEvento = tipoeventi.NomeTipoEvento }; return(Ok(tipoEventoDto)); }