Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SetupDatabase();

            using (var db = new BloggingContext())
            {
                var blog = new Blog();
                blog.Name = "Rowan's Blog";
                blog.SetUrl("http://romiller.com");

                db.Blogs.Add(blog);
                db.SaveChanges();

                var blogs = db.Blogs
                    .OrderBy(b => b.Url)
                    .ToList();
            }
        }