Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created August 14, 2019 17:02
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 debugmodedotnet/241468304ffd7ec2927be9b3a9a8574c to your computer and use it in GitHub Desktop.
Save debugmodedotnet/241468304ffd7ec2927be9b3a9a8574c to your computer and use it in GitHub Desktop.
[Route("gettrainings/{id:int}")]
[HttpGet]
public IHttpActionResult GetTraining(int id)
{
var training = trainings.FirstOrDefault((t) => t.Id == id);
if(training == null)
{
return NotFound();
}
return Ok(training);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment