Entity Framework in layered architecture

后端 未结 3 667
悲哀的现实
悲哀的现实 2021-02-03 12:38

I am using a layered architecture with the Entity Framework. Here\'s What I came up with till now (All the projects Except UI are class library):

  • Enti

3条回答
  •  别跟我提以往
    2021-02-03 12:44

    The problem is that I have to define the entities connection string in my UI's web.config/app.config otherwise I get a runtime exception.

    The connection string is always picked up from the app.config/web.config of the executing appDomain (here your asp.net app and not the DAL). So wat you can do is create a xml file for storing settings in your DAL project and read those settings using xml classses provided by dot net framework

提交回复
热议问题