Last post Oct 22, 2014 09:41 PM by Kevin Shen - MSFT
Oct 21, 2014 04:14 PM|dl0haus|LINK
I have a web application that uses the entity framework to access a SQL database. This application is comprised of a bunch of forms with data access. We wanted to have a different version of the same entity by "hot swapping" an entity at build or run time
to access an almost identical database that is residing in a different location.
We basically have a main web application that is part of a namespace. The name space would be DOH.Web.MyApplication. The Entity for this is in its own project with the namespace of DOH.DataLayer.MyDataLayer. We wanted to add another one called DOH.DataLayer.MyOtherDataLayer
that has the same definition but connects to a different database at a different location (but has the same schema).
The reason for this is so we can run the same web application off a web server or off a local instance of IIS (for a mobile device) where the data stores are separate from one another. One in this case would be on the server, one on the mobile device. The
mobile device updates its own version of the database (lets say on a Surface Pro)... when the user returns home, they would "sync" the mobile database with the server one.
Is there any way to make Entities "hot swappable" at runtime with some kind of runtime binding, or is there a way to selectively include or not include a particular DataLayer?
Oct 22, 2014 09:41 PM|Kevin Shen - MSFT|LINK
As far as I know, it seems that there is no additional property to mark the entities "hotswappable".
And according to your description,it seems that you are wanting to asyn the data in your two database.
I suggest that you can google how to keep the data same in different database with the same schema.