public async Task <IActionResult> GetLevels() { try { var levels = await levelService.GetAllLevels(); if (levels == null) { return(NotFound()); } return(Ok(levels)); } catch (Exception) { return(BadRequest()); } }
public ActionResult <IEnumerable <LevelReadDto> > GetAllLevels() { return(Ok(_service.GetAllLevels())); }