using EntityFrameworkCoreSample.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace EntityFrameworkCoreSample
{
    public static class SeedData
    {
        public static void Seed(BloggingContext db)
        {
            db.Blogs.Add(
                new Blog
                {
                    Name = "Fish Blog",
                    Url = "https://www.xcode.me/blogs/fish",
                    Posts = new List<Post>
                    {
                        new Post { Title = "Fish care 101"},
                        new Post { Title = "Caring for tropical fish"},
                        new Post { Title = "Types of ornamental fish" }
                    }
                });

            db.Blogs.Add(
                new Blog
                {
                    Name = "Cats Blog",
                    Url = "https://www.xcode.me/blogs/cats",
                    Posts = new List<Post>
                    {
                        new Post { Title = "Cat care 101" },
                        new Post { Title = "Caring for tropical cats", },
                        new Post { Title = "Types of ornamental cats"}
                    }
                });

            db.Blogs.Add(
                new Blog
                {
                    Name = "Catfish Blog",
                    Url = "https://www.xcode.me/blogs/catfish",
                    Posts = new List<Post>
                    {
                       new Post { Title = "Catfish care 101",},
                       new Post { Title = "History of the catfish name"}
                    }
                });

            db.SaveChanges();
        }
    }
}
