Created
July 18, 2019 08:25
-
-
Save ntakouris/9beb826a89ad506ca0a3a47d1c0bd027 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
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Tweetbook.Domain; | |
namespace Tweetbook.Controllers.V1 | |
{ | |
public class PostsController : Controller | |
{ | |
private List<Post> _posts; | |
public PostsController() | |
{ | |
_posts = new List<Post>(); | |
for (var i = 0; i < 5 i++){ | |
_posts.Add(new Post{Id = Guid.NewGuid().ToString()}); | |
{ | |
} | |
[HttpGet("api/v1/posts")] | |
public IActionResult GetAll() | |
{ | |
return Ok(_posts); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment