开发者

Accessing application variables in DataAccesslayer (another project under same solution)

开发者 https://www.devze.com 2022-12-09 19:30 出处:网络
I have a solution with 3 projects.One of UI (contains web pages) 开发者_StackOverflowand one for BL and one for DataAccess layer.Now i want to access one values stored in application variable in one c

I have a solution with 3 projects.One of UI (contains web pages) 开发者_StackOverflowand one for BL and one for DataAccess layer.Now i want to access one values stored in application variable in one class inside my DataAccess layer project.How can i access application variables there ?


I recommend passing the value through your different layers.

You could probably use HttpContext.Current... to access it directly, but doing it that way would mean you now have a dependancy on Session state in your DAL, which will make testing and maintainance more awkward.


You need to pass the current HTTPContext to the DAL.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号