Reputation: 480
I've got a MVC 4 Website which uses CodeFirst.
I want to interact with the same database/model in an WebService and I have some problems which design approach I should take here? I've tried referencing my MVC 4 Solution and the EntityFramework.dll in the Webservice.. that doesn't work and also does not seem to be a good way of doing it.
can anyone give me a good starting point how to do this?
Upvotes: 0
Views: 195
Reputation: 18387
Since you already have a DB, you could use Database First strategy:
http://msdn.microsoft.com/en-us/data/jj206878.aspx
But if you want to use Code fist, here's a good resource:
http://msdn.microsoft.com/en-us/data/jj200620.aspx
Just pay attention with the DB Initializer, since you already have a DB, you must not use "DropCreateDatabaseAlways" neither "DropCreateDatabaseWhenModelChanges". You should use Migrations to control changes to DB.
Upvotes: 1