Database connection strings used to be simple. Well, simple, once you learned the arcane syntax, But, at least they had stayed the same for about a decade. But with the EntityFramework, they took on an even more arcane "connection string – within –a –connection string" format. And while the inner connection string related to your database, the wrapping connection string was intimately tied to the entity context.
So, in that past, one App.config connect string entry was good for all your DB needs for one database. Now, if you have several different EF contexts, all referring to tables in the same physical database, you need to have several connection strings, with the outer string different and the inner part the same --- until you need to connect to a different database, then you leave the existing outer strings and change all the inner string in parallel. This really seems to me to be a design flaw on Microsoft's part, but let's see if we can work something to make it easier. We'd really like to have one connection string for all our EF needs.
Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
So, in that past, one App.config connect string entry was good for all your DB needs for one database. Now, if you have several different EF contexts, all referring to tables in the same physical database, you need to have several connection strings, with the outer string different and the inner part the same --- until you need to connect to a different database, then you leave the existing outer strings and change all the inner string in parallel. This really seems to me to be a design flaw on Microsoft's part, but let's see if we can work something to make it easier. We'd really like to have one connection string for all our EF needs.
Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
[C#][.NET][Dev][Intermediate]
No comments:
Post a Comment