将下面选择DataSource, 选择MySQL database 做为数据源.
接下来几步和以前一样,选择要Mapping的Tables:
好了,让我们来测试一下:
1: using(var context = new MySqlEntities())
2: { var myEvents = from e in context.Events
3: from a in e.Attendees
4: where a.Person.FirstName == "Gunnar" &&
5: a.Person.LastName == "Peipman"
6: select e; Console.WriteLine("My events: ");
7: foreach(var e in myEvents)
8: {
9: Console.WriteLine(e.Title);
10: }
11: }
可以工作.就是这么简单. 另一个消息是Entity Framework Code-First (CTP5 发布了). 如果您有兴趣可以看一下.
希望这篇POST对您开发有帮助.