sql - Entity Framework 6 with Azure DB secondary connection -
i'm facing problem ef against azure db secondary connection. here problem:
- i'm using ef 6 code first
- i setup primary azure db 2 active geo-replicated secondary database (have difference server , db name login account)
- i use ef6 manipulate primary azure db. case if primary db down (by reason) , want switch active secondary dbs select statements @ runtime. how can achieved that?
notes: example, have code snippet below:
using (appcontext context = new appcontext()) // appcontext derived dbcontext , using primary connection string { var users = await context.users.tolistasync(); // if line of code failed primary connection string }
i want auto-switch dynamically secondary db if line var users... failed @ runtime. recommendation?
thanks help!
Comments
Post a Comment