EF4 Code First make tables names singular

后端 未结 2 1191
迷失自我
迷失自我 2021-01-01 23:09

I\'m using standards for singular table names. EF4 Code First has by default to pluralize table names. I have put the code to override this convention, but seems is not work

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 00:00

    Your using the wrong convention. You need to do the below.

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {    
        modelBuilder.Conventions.Remove();
    }
    

提交回复
热议问题