public async Task <IActionResult> GetById([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var transit = await _transitRepository.GetAsync(id); if (transit != null) { return(Ok(transit)); } else { return(BadRequest()); } }