entity framework 6 - Access related data from two databases through a single EF 6 data layer -


my team separate user data our core application data. we're using sql server 2014 , ef 6.x code first. if create users database , application database there way tell ef relationship between user object , and order object? assuming orders stored in application database , users stored in users database. know instantiate user users database , query application database list of orders, we're looking solution functions if tables both in same database, such when user retrieved list of orders available without second call.

basically, we're looking way map entities specific context , instantiate each context pointing respective database , let ef sort out calls.

yes, need configuration 1 database servers.

your application database can define synonym table in users database, can map entity if normal table in application db.

as far entity framework concerned, uses same dbcontext pointing application database, can pull information users database.

one downside application database needs setup point @ specific users database.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -