문제

I have a 4 tier web api project :

Web Api - Entities - Business Logic - Data Access

..and I am using code first with an empty context constructor so the connection string is picked up from the web.config in my Web Api project :

 public MyContext() : base()
    {

    }

Question is, can I read the serverName and databaseCatalog from a .settings file and modify the connection string at runtime?

도움이 되었습니까?

해결책

I ended up building the connection string in the business layer and passing it down through layers in the constructor.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top