Created
August 14, 2019 17:02
-
-
Save debugmodedotnet/241468304ffd7ec2927be9b3a9a8574c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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