Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created July 18, 2019 08:25
Show Gist options
  • Save ntakouris/9beb826a89ad506ca0a3a47d1c0bd027 to your computer and use it in GitHub Desktop.
Save ntakouris/9beb826a89ad506ca0a3a47d1c0bd027 to your computer and use it in GitHub Desktop.
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