Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8492059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:36:35+00:00 2026-06-10T22:36:35+00:00

My business layer creates files and needs to save them in the App_Data folder

  • 0

My business layer creates files and needs to save them in the App_Data folder of my asp.net mvc 4 web frontend.

I could use Server.MapPath in the business layer to get the physical path of the App_Data folder. But i want to avoid a reference to System.Web in the business layer.

Are there other ways to get the path to App_Data in business layer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:36:37+00:00Added an answer on June 10, 2026 at 10:36 pm

    The correct way to deal with this is to have the presentation layer pass the path into the business layer.

    To put this another way, the purpose of having a business layer is to create a separation of concerns between the ui and business processes. If you force the business process to know about the ui layer, then you are violating that separation of concerns.

    There are a number of ways you could deal with this. You could pass the path into the business layer when the business layer is constructed, such as via constructor initialization or through dependency injection. Or you could pass it to the method call. Or you could create some form of configuration file that your business layer loads that contains the path.

    There are lots of ways of going about this that do not violate separation of concerns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an application with the following structure. // ASP.NET MVC (Web Project)
I'm working on an ASP.NET MVC App that has buttons that have the server
I have an ASP.NET web site that has a entities version 4.0 DAL. I
I have a web app with a presentation layer and a business layer as
Our Asp.net web application is using LINQ-to-SQL (Stored Procs are dragged on dropped on
I have a system written in ASP.Net 2.0 Web Form. The framework that talks
I've been working on a ASP.NET MVC project with LinqToSql. The application has 3
I'm building an asp.net mvc application for users to enter an essay contest. I
i created the following sample method in business logic layer. my database doesn't allow
I currently represent my Business Layer and Data Layer in a single project in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.