public async Task <ActionResult <Ninja> > GetNinja(long id) { try { var result = await ninjaRepository.GetNinja(id); if (result == null) { return(NotFound()); } return(result); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from database")); } }
public Ninja Get(string id) { return(_ninjaRepository.GetNinja(id)); }