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 256711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:02:12+00:00 2026-05-11T22:02:12+00:00

Seeing as though I’ve now solved all of my LINQ problems I’m not working

  • 0

Seeing as though I’ve now solved all of my LINQ problems I’m not working on developing an actual model. The thing is with this is that I do not want to be tied in to a single technology, I want to have freedom to implement different data access technologies and work to a single interface.

Now, I’ve never done this before, but based on my OOP knowledge and experience I was coming up with an idea like the following:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;

namespace Intranet.Data.Accounts
{
  interface IContractsControl
  {
    ContractsControlViewData GetContracts(System.Nullable<int> contractTypeID,
                                  System.Nullable<int> responsibilityID,
                                  string expenseType,
                                  System.Nullable<int> supplierID,
                                  string businessID);

    ContractsControlViewData GetContract(int contractID);
  }
}

I’ve got a few questions on how this should work.

  1. Where should the interface live, taking into account I’m using an areas lib developed by Phil Haack. For now I’ve created a folder called “Data” at the root level (as you can see from the namespace).
  2. Our stored procedures have spurious names because they’re pooled into a database, if I’m using objects I can instead work towards an object-based solution for access to sprocs. Do the names in my data access library have to reflect that of the stored procedure in this instance?
  3. Using a library such as this would allow me to do Accounts.GetContracts() in my controller. Is this wise?
  4. Are there any design recommendations for this approach? i.e. naming schemes.
  5. Where should the actual implementation live? In the same folder as the interface?

The idea is that if we ever ditch LINQ then we can instead use a different data access technology (entity framework, plain ol’ SQL etc.). I’d love to hear comments/criticisms/appraisals from those more experienced.

  • 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-11T22:02:12+00:00Added an answer on May 11, 2026 at 10:02 pm

    Your approach looks much like the Repository Pattern, praised by many ASP.NET MVC tutorial writers… =) Here’s a tutorial which describes how to make an existing application loosely coupled, and one thing (among others) it shows is how to implement the Repository Pattern in ASP.NET MVC.

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

Sidebar

Related Questions

I am seeing this somehow odd problem (even though I have the feeling I
Maybe seeing the issue would help you all a little: https://ws.onehub.com/files/nzvrbj4s Screen Shots: https://ws.onehub.com/files/9rw3li12
This happens on OS X, though I suspect it applies to any UNIX-y OS.
having a strange issue, must be something I'm just not seeing. I set up
Seeing as though our team maintain an Intranet which has clients users guaranteed to
I am seeing a random exception Collection was modified; enumeration may not execute -
Seeing as though ASP.NET MVC 2 Preview 1 was just released it means the
I am using SQL Server Reporting Services 2008 (though this seems to be an
I tried doing something like Time.now + 5.days but that doesn't work, even though
I am doing the following in my php script and I am not seeing

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.