Entity Framework (4.3) looking for singular name instead of plural (when entity name ends with “s”)

后端 未结 4 1936
半阙折子戏
半阙折子戏 2021-02-05 15:25

Here\'s my situation: I have been working on an ASP.NET MVC 3 application for a while. It has a database (built out of a db project; I\'m going db-first) for which I have an edm

4条回答
  •  生来不讨喜
    2021-02-05 16:09

    You mention EDMX but I can't tell if you are doing databse first with EDMX or code first and just using EDMX to see what's going on.

    If you are using Code First, then you can use a configuration to specify the table name. Data Annotation is [Table("TransactionStatuses")], fluent is modelBuilder.Entity().ToTable("TransactionStatuses"). (I'm typing the annotation and fluent code from memory so double check references. ;) )

    If you are using database first, the SSDL should absolutely be aware of the name of the database table, so I'm guessing that you are using code first & the edmx is just for exploration. (???)

    hth

提交回复
热议问题