求ASP .NET MVC4 IN ACTION的中文版本啊,英文看着好多不懂啊!

墨_yan 2013-07-17 03:13:00
谁有ASP .NET MVC4 IN ACTION 中文版本啊;英文有好多地方看不懂,不理解,谢谢亲啊!!!
...全文
252 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
墨_yan 2013-07-24
  • 打赏
  • 举报
回复
引用 3 楼 xl5517579 的回复:
[quote=引用 2 楼 wangzaiwangzai 的回复:] [quote=引用 1 楼 xl5517579 的回复:] 我想问我有一个四字的学生表(id,name,sex,age)在vs2010中用MVC4来构建网站的时候在设计Model类的时候要怎么设计?
public class StudentTable { public int Id{ get; set;} public string Name { get; set;} public string Aex { get; set;} public int Age { get; set;} }[/quote] 你这里的Id Name Aex Age 没有什么要求吗?那怎么能和数据库联系起来并进行数据存取?[/quote] 你先建个数据库,然后手动建表,表的每个属性对应的名称分别为Id Name Sex Age,然后你在MOdel文件夹里添加一个StudentTableContext类,并让它继承DbContext类,(注意要导入命名空间),如下: public class StudentTableContext : DbContext { public StudentTableContext():base("StudentTable"){}//StudentTable是数据库的名称 public DbSet<StudentTableEntry>Entries{ get; set;}//StudentTableEntry是你建的表的名称 }
xl5517579 2013-07-24
  • 打赏
  • 举报
回复
引用 2 楼 wangzaiwangzai 的回复:
[quote=引用 1 楼 xl5517579 的回复:] 我想问我有一个四字的学生表(id,name,sex,age)在vs2010中用MVC4来构建网站的时候在设计Model类的时候要怎么设计?
public class StudentTable { public int Id{ get; set;} public string Name { get; set;} public string Aex { get; set;} public int Age { get; set;} }[/quote] 你这里的Id Name Aex Age 没有什么要求吗?那怎么能和数据库联系起来并进行数据存取?
墨_yan 2013-07-24
  • 打赏
  • 举报
回复
引用 1 楼 xl5517579 的回复:
我想问我有一个四字的学生表(id,name,sex,age)在vs2010中用MVC4来构建网站的时候在设计Model类的时候要怎么设计?
public class StudentTable { public int Id{ get; set;} public string Name { get; set;} public string Aex { get; set;} public int Age { get; set;} }
xl5517579 2013-07-18
  • 打赏
  • 举报
回复
我想问我有一个四字的学生表(id,name,sex,age)在vs2010中用MVC4来构建网站的时候在设计Model类的时候要怎么设计?

17,747

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧