2016年1月5日
摘要: 数据库自动获取时间[DatabaseGenerated(DatabaseGeneratedOption.Computed)]Required 注释告诉 EF 某一个特定属性是必需的。[Required]public string Title { get; set; }声明字段长度(1)MaxLeng... 阅读全文
posted @ 2016-01-05 11:40 the_best 阅读(285) 评论(0) 推荐(0) 编辑
摘要: public class Student { public int Id { get; set; } public string Name { get; set; } public int ProvinceId { get; set; } public Province Province { ge... 阅读全文
posted @ 2016-01-05 11:06 the_best 阅读(1213) 评论(0) 推荐(0) 编辑
摘要: 创建一个类Modelpublic class Student { public int Id { get; set; } [Display(Name = "姓名")] public string Name { get; set; } public string SClass { get; set; ... 阅读全文
posted @ 2016-01-05 09:04 the_best 阅读(585) 评论(0) 推荐(0) 编辑
  2016年1月4日
摘要: BookContext db=new BookContext();public ActionResult Index() { List students = new List() { new Students{Id=1,Name="Ava"}, new Students{Id=2,Name="z"}... 阅读全文
posted @ 2016-01-04 21:57 the_best 阅读(131) 评论(0) 推荐(0) 编辑
摘要: @if (Request.IsAuthenticated){ 你好,@Html.ActionLink(User.Identity.Name, "Manage", "Admin", routeValues: null, htmlAttributes: new { @class = "us... 阅读全文
posted @ 2016-01-04 21:35 the_best 阅读(141) 评论(0) 推荐(0) 编辑
  2015年12月28日
摘要: 建立Models public int Id { get; set; } [DisplayName("用户名")] public string UserName { get; set; } [DisplayName("密码")] [DataType(DataType.Password)] publi... 阅读全文
posted @ 2015-12-28 16:00 the_best 阅读(203) 评论(0) 推荐(0) 编辑