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

  • Home
  • SEARCH
  • 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 7184567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:13:42+00:00 2026-05-28T18:13:42+00:00

First some background, I am currently working on a relatively large Asp.Net MVC application

  • 0

First some background,

I am currently working on a relatively large Asp.Net MVC application that I have tried, as much as possible, to design around a domain driven model, using good design principles. We are required to do all database access via stored procedures (Oracle). In this application, I have a variety of controllers that use service objects to do business logic and in turn call on repository objects to accomplish access.

I have just been informed that the dba requires several common parameters to be passed to every stored procedure in addition to the parameters required to fetch/update/insert the data. These parameters include the username, ip address and domain of the user making the original web request. This data is then used in by each stored procedure to call functions that log access and check that the user has permissions to execute that particular stored procedure.

I have tried to gently explain that I feel this is poor design and that the .Net application could simply call stored procedures dedicated to logging and checking permissions whenever necessary. Unfortunately, this methodology is well established in the environment and the dba is unwilling to change it.

So now to my question,

Does anyone have any good ideas on how I can accomplish retrieving these extra parameters and deliver them to the repository objects without making a huge mess? From what I can tell this data is only available from the web context when in the controller layer. This means passing the extra data to class in the service layer and then on to each repository class. I’d like to minimize the pain here as much as possible.

  • 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-05-28T18:13:43+00:00Added an answer on May 28, 2026 at 6:13 pm

    If you are using dependency injection (you are aren’t you – it is a larger project)
    you can simply inject the service into the controller. The repository then is injected into the service. The repository’s construction would take IUserSettings (or whatever its called) which is a concrete implementation of the details you require. Its then available to every repository.

    public YourRepositoryClass(IUserSettings userSettings)
    {
     _userSettings = userSettings;
    }
    

    and voila – its available.

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

Sidebar

Related Questions

First some background: VB.NET 2005 Application that accesses a MS-SQL back-end, using multiple Web
First some background: I'm working on an application and I'm trying to follow MVVM
A little background I'm working on an .net application that's uses plugins heavily, the
First some background. We have a vendor application which generates logs and configuration files
First, some background: I'm developing a web application using Python. All of my (text)
Here's some background info. I have three MySQL tables (all InnoDB). The first table
I am currently working in a .Net project but from university I have also
I'm currently working on this project that implies some DSP skills. I must extract
Here's the background info first. ASP.NET 2.0 Web Site with AJAX Extensions 1.0. I
I have written a wrapper application in .Net that starts another WinForms application with

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.