public void SeedingComment() { var users = _databaseServices.GetUsers(); var post = _databaseServices.GetPosts(); //A bunch of comments Comments c1 = new Comments(); c1.PostId = post[0].Id; c1.text = "Hey there boi"; c1.commenterId = users[1].Id; Comments c2 = new Comments(); c2.PostId = post[0].Id; c2.text = "How's it hanging"; c2.commenterId = users[0].Id; Comments c3 = new Comments(); c3.PostId = post[0].Id; c3.text = "We are runing out of time :("; c3.commenterId = users[1].Id; Comments c4 = new Comments(); c4.PostId = post[2].Id; c4.text = "Så kan vi være det sammen"; c4.commenterId = users[1].Id; Comments c5 = new Comments(); c5.PostId = post[3].Id; c5.text = "Nice XD"; c5.commenterId = users[2].Id; Comments c6 = new Comments(); c6.PostId = post[6].Id; c6.text = "Det håber jeg ikke :P"; c6.commenterId = users[4].Id; Comments c7 = new Comments(); c7.PostId = post[4].Id; c7.text = "Er du nu sikker på det, det kunne jo være noget godt, som du siger nej til :)"; c7.commenterId = users[2].Id; _databaseServices.CreateComments(c1); _databaseServices.CreateComments(c2); _databaseServices.CreateComments(c3); _databaseServices.CreateComments(c4); _databaseServices.CreateComments(c5); _databaseServices.CreateComments(c6); _databaseServices.CreateComments(c7); }
public ActionResult <Comments> Create(Comments comment) { _databaseServices.CreateComments(comment); return(CreatedAtRoute("GetUser", new { id = comment.Id.ToString() }, comment)); }