Created
July 20, 2019 16:19
-
-
Save ntakouris/ae7cf35acbaac07ad70676eaa82d5602 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private readonly IPostService _postService; | |
public PostsController(IPostService postService) { | |
_postService = postService; | |
} | |
[HttpGet(ApiRoutes.Posts.Get)] | |
public IActionResult Get([FromRoute] Guid postId) | |
{ | |
var post = _postService.GetPostById(postId); | |
if (post == null) | |
return NotFound(); | |
return Ok(post); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment