随笔分类 - Mvc EF
摘要:1.添加模型类: public class Product { public int Id { get; set; } public string Name { get; set; } public string Category { get; s...
阅读全文
摘要:打开程序包管理控件台:Install-Package FubarDev.NDbUnit.SqlServerCeWeb.config中修改:
阅读全文
摘要:Controller [ValidateAntiForgeryToken] [HttpPost] public ActionResult Index(FormCollection focm) { string name = focm["Name"]; ViewBag.Message ...
阅读全文
摘要://Student.cspublic int Id{get;set;}public string name{get;set;} //SchoolContext.cspublic class SchoolContext : DbContext{public SchoolContext(): base(...
阅读全文
摘要:程序包管理控制台:敲入Enable-Migrations;修改:AutomaticMigrationsEnabled = true;Global.asax中添加:Database.SetInitializer(new MigrateDatabaseToLatestVersion()) ;
阅读全文
摘要:创建学生实体在 Models 文件夹中,创建 Student.cs 类,添加代码:publicint StudentID { get; set; } publicstring LastName { get; set; } publicstring FirstMidName { get; set; }...
阅读全文

浙公网安备 33010602011771号