Entity Framework and distributed Systems
- by Dirk Beckmann
I need some help or maybe only a hint for the right direction.
I've got a system that is sperated into two applications.
An existing VB.NET desktop client using Entity Framework 5 with code first approach and a asp.net Web Api client in C# that will be refactored right yet. It should be possible to deliver OData.
The system and the datamodel is still involving and so migrations will happen in undefined intervalls.
So I'm now struggling how to manage my database access on the web api system. So my favourd approch would be us Entity Framework on both systems but I'm running into trouble while creating new migrations. Two solutions I've thought about:
Shared Data Access dll
The first idea was to separate the data access layer to a seperate project an reference from each of the systems. The context would be the same as long as the dll is up to date in each system. This way both soulutions would be able to make a migration.
The main problem ist that it is much more complicate to update a web api system than it is with the client Click Once Update Solution and not every migration is important for the web api. This would couse more update trouble and out of sync libraries
Database First on Web Api
The second idea was just to use the database first approch an on web api side. But it seems that all annotations will be lost by each model update.
Other solutions with stored procedures have been discarded because of missing OData support and maintainability.
Does anyone run into same conflicts or has any advices how such a problem can be solved!