c# - What's the proper way to set up a WCF service with a EF database? -


i'm working on project become more familiar wcf services , entity framework , ran road block. have simple wcf service ef code first database context implemented in separate class library. have console application host service , client use service. leaves me following 2 questions:

  1. given i'm using 'code first new database', proper place initialize database? service handle or should initialized within service host? idea create/initialize database within host , treat existing database within service.

  2. a regular user client should have read access database; however, i'll need along lines of 'admin' client has ability add/remove entries. correct way have multiple clients access database through single service, provide them different permissions?

i've taken @ following 2 articles - this one , this one. however, these both discuss using existing database , didn't answer questions. in advance!

1) service host should not know db platform in next day can host service windows service example , don't want copy code between hosts,so it's better initalize in service (by using separated dal)

2) mange application privileges , pass access token each client, can base code sync ad,self-development ot other method like


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -