创建数据模型
摘要:
---恢复内容开始---使用code fist模式,得先建立数据模型,例子中先列出3个:Student类,Enrollment类,Course类。一个学生可以有多个课程登记,一个登记记录只对应一个学生这就是 one-to-many(一对多)关系Course类和Enrollment也是一对多的关系在Models文件夹中创建一个Student类usingSystem;usingSystem.Collections.Generic;namespaceContosoUniversity.Models{ publicclassStudent { public int StudentID{get... 阅读全文
posted @ 2013-01-30 23:09 蓝色海 阅读(268) 评论(0) 推荐(0)
浙公网安备 33010602011771号