-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEF.cs
More file actions
26 lines (22 loc) · 737 Bytes
/
EF.cs
File metadata and controls
26 lines (22 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
namespace vscode
{
public static class EF
{
public static void Run()
{
using (var db = new BloggingContext())
{
//db.Blogs.Add(new Blog { Url = "http://blogs.msdn.com/adonet" });
//var count = db.SaveChanges();
//Console.WriteLine("{0} records saved to database", count);
Console.WriteLine();
Console.WriteLine("All blogs in database:");
foreach (var blog in db.Blogs)
{
Console.WriteLine(" - {0}", blog.Url);
}
}
}
}
}