views:

69

answers:

2

I have a solution with 3 projects.One of UI (contains web pages) and 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 ?

+1  A: 

Hi there.

You need to pass the current HTTPContext to the DAL.

Cheers. Jas.

Jason Evans
+2  A: 

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.

Bravax
I agree, the data has to be extracted from HttpContext.Current and populate the business layer which handles the DAL. We don't want any dependancies between layers.
armannvg

related questions