Can you have a DbContext that is associated with multiple databases?

前端 未结 1 1311
离开以前
离开以前 2021-01-20 18:13

I have a User database that houses all of the user information plus permissions to applications, etc. If I have a general database as described and then other databases for

1条回答
  •  清酒与你
    2021-01-20 19:06

    The answer is no. The context is related to a single database. There is even no easy way to hack this because the context still can create queries only for a single database so if you want to have access to multiple databases you need either a context for each database (no cross context queries or relations exists) or you need to expose all tables from other databases as views or aliases in the database used by the context.

    0 讨论(0)
提交回复
热议问题