MVC5 + EF6 简单示例(转载)
MVC4+EF5+EasyUI+Unity3依赖注入(1)- 系统简要说明
http://www.cnblogs.com/hbsi/p/3632015.html
ASP.NET MVC5 网站开发实践
http://www.cnblogs.com/mzwhj/archive/2014/03/30/3634397.html
EF5&MVC4 学习1、创建新的Contoso University Application,并创建Model Class 生成对应的database
http://www.cnblogs.com/siri/p/3628017.html
http://www.cnblogs.com/siri/category/558088.html
Creating an Entity Framework Data Model for an ASP.NET MVC Application (1 of 10)
最终效果如下图
模型类和数据上下文都是下拉菜单选择的。注意:在选择之前先编译一下你的代码,否则是找不到模型类和数据上下文类的
服务器资源管理器:
另外关于:
using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using EF6Demo.Models; namespace EF6Demo.DAL { public class CommunicationContext:DbContext { public CommunicationContext() : base("CommunicationContext") { } public DbSet<EF6Demo.Models.Contact> Contacts { get; set; } public DbSet<EF6Demo.Models.Enrollment> Enrollments { get; set; } public DbSet<EF6Demo.Models.Group> Groups { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { //base.OnModelCreating(modelBuilder); modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); } } }
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();可以参考:
Entity Framework creates a plural table name, but the view expects a singular table name?