Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Situation: I have two Applications. One is an API and the other is my Web Application.

edit: only the API has Access to the Database

Idea: Is it possible to also use Entity Framework in my Web Application with the API as Datasource instead of an actual Database?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
687 views
Welcome To Ask or Share your Answers For Others

1 Answer

If I good understand your case, you have two applications which are connected to the same database? I think you have two options:

  1. First is create third project "Repository" with database access logic and use it in both applications.

  2. Use your API as source for WebApplication Data - just from actions in WebApp controllers make HTTP calls to your api (eg. http://localhost/api/path).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...