Can't have the same table names in different entity framework models?

前端 未结 5 1567
心在旅途
心在旅途 2021-01-07 23:13

My application uses two different SQL 2008 databases. The databases have a few tables with the same name, ie. Users. I would like to use EF4 for both these data

5条回答
  •  北海茫月
    2021-01-07 23:43

    For DB first approach, Luckily there are couple of workarounds which are pretty straightforward:

    1. Make sure that that both contexts don't share tables with the same name - not the most practical approach.
    2. Restructure the solution by isolating the database contexts within their own assemblies.

    For more detail, please refer this link

    Explained very clearly.

提交回复
热议问题