Batching.Program.SetupDatabase C# (CSharp) Метод

SetupDatabase() приватный статический Метод

private static SetupDatabase ( ) : void
Результат void
        private static void SetupDatabase()
        {
            using (var db = new BloggingContext())
            {
                db.Database.EnsureCreated();

                if (db.Blogs.Any())
                {
                    db.Database.ExecuteSqlCommand("DELETE FROM dbo.Blogs");
                }

                db.Blogs.Add(new Blog { Name = "The Dog Blog", Url = "http://sample.com/dogs" });
                db.Blogs.Add(new Blog { Name = "The Cat Blog", Url = "http://sample.com/cats" });
                db.SaveChanges();
            }
        }
    }