Skip to content

Instantly share code, notes, and snippets.

@siposm
Created January 30, 2021 13:32
Show Gist options
  • Save siposm/6dcf70a32205ea872397ff2a9ec21323 to your computer and use it in GitHub Desktop.
Save siposm/6dcf70a32205ea872397ff2a9ec21323 to your computer and use it in GitHub Desktop.
HFT MINFO DB INIT code snippet
#region INIT
BlogContext db = new BlogContext();
Blog b1 = new Blog() { Category = "Nature", LikesCount = 43, Title = "#1 Nature Article" };
b1.Comments.Add(new Comment() { Content = "Lorem ipsum dolor sit amet." });
Blog b2 = new Blog() { Category = "Nature", LikesCount = 30, Title = "#2 IT life in the nature" };
b2.Comments.Add(new Comment() { Content = "Great article, loved it!" });
Blog b3 = new Blog() { Category = "Design", LikesCount = 120, Title = "#3 Science of Design" };
b3.Comments.Add(new Comment() { Content = "Fantastic reading." });
b3.Comments.Add(new Comment() { Content = "Thanks for sharing this stuff!" });
b3.Comments.Add(new Comment() { Content = "Waste of tiiiiiiiiiiiime...." });
b3.Comments.Add(new Comment() { Content = "Lorem ipsum." });
b3.Comments.Add(new Comment() { Content = "Dolor sit amet." });
Blog b4 = new Blog() { Category = "Design", LikesCount = null, Title = "#4 Designing a PWA" };
b4.Comments.Add(new Comment() { Content = "This is pure SH!T." });
b4.Comments.Add(new Comment() { Content = "Good words used here!" });
Blog b5 = new Blog() { Category = "Architecture", LikesCount = 300, Title = "#5 Architecture on Mars" };
b5.Comments.Add(new Comment() { Content = "Some words were incorrect." });
db.Blogs.Add(b1);
db.Blogs.Add(b2);
db.Blogs.Add(b3);
db.Blogs.Add(b4);
db.Blogs.Add(b5);
db.SaveChanges();
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment