Change table name at runtime

后端 未结 7 1889
陌清茗
陌清茗 2020-12-17 03:22

Lets suppose that I have a db table with name Employee and a respective EF 6.0 db-first model.

Getting all rows of table Employee is done through q

7条回答
  •  無奈伤痛
    2020-12-17 04:09

    You must create a new dbcontext that inherits from the db-first model context and treat it like code-first in ef. Check the link, please. Same problem as yours.

    https://www.codeproject.com/Articles/421643/How-to-Use-MVC-Net-on-the-Dynamics-NAV-Database-St#_articleTop

    So when mapping, you can get the table name dynamically.

提交回复
热议问题