Skip to content

Instantly share code, notes, and snippets.

@binerdy
Created February 5, 2020 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binerdy/8539829085aefd8e222f3ca5cda52a89 to your computer and use it in GitHub Desktop.
Save binerdy/8539829085aefd8e222f3ca5cda52a89 to your computer and use it in GitHub Desktop.
[HttpGet("{id}")]
public async Task<ActionResult<Employee>> GetEmployeeById(long id)
{
try
{
Employee employee = await _employeeRepository.Get(id);
return Ok(employee);
}
catch (Exception e)
{
return NotFound(e.Message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment