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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:38:24+00:00 2026-05-22T21:38:24+00:00

My company uses stored procs for all SELECT operations so it’s making it rather

  • 0

My company uses stored procs for all SELECT operations so it’s making it rather difficult for me to create sensible navigation properties. I’m not too concerned at this point whether they’re lazy loaded or not.

So for example I created an entity for Customer then created a FunctionImport to map GetAllCustomersSP to return a collection of Customer entities. But I want a navigation property “Orders” on each Customer entity.

But if I use the Customer entity partial class to just add this property, the problem is that I don’t have access to the original Context, so I can’t call the GetCustomerOrdersSP either explicitly or deferred.

The only option I can see is to modify my repository to add these properties in explicitly, which seems lame because it puts the entity logic into the repository.

Is there something I’m missing here? I can see in the entity model designer that I can specify custom insert, update, delete SPs but I don’t see any way to use select SPs to actually retrieve the data.

  • 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-22T21:38:25+00:00Added an answer on May 22, 2026 at 9:38 pm

    I agree with Tim here…any solution you come up with isn’t going to fully leverage the ORM and will be a potential nightmare to maintain. I would suggest creating a model, in code, that is framed in the manner in which you want to develop.

    In the Data Access layer of your app, you can map your data objects that use SPs to hydrate your model objects (have a look at AutoMapper). Your app will only know about your model objects.

    Doing this will give you a consistency in how you interact with the objects, and you can begin to apply pressure to the powers that be to allow more fine grained access to the tables, at which point, you can adjust your Data Access Layer to support EF and remove SPs. At this point you would be able to consider migrating the objects you created to POCO objects that are persisted via EF.

    We had a similar issue in that granting raw DB access was “forbidden”. We overcame this problem by using a model in which we only grant access to tables as they are used, not the entire database, and by ensuring the DBA that EF uses parameterized SQL, eliminating the concern of SQL Injection.

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

Sidebar

Related Questions

My company uses raw, untyped DataSets filled via Stored Procedures exclusively. I have been
Our company uses Citrix to remote into a terminal server for remote users to
My company uses StarTeam for source control and CR management, but I would really
Our company uses an app that was originally ColdFusion + Access later converted to
My company uses a sales model of dealers, territory managers and regional managers, each
My company uses usenet groups on an internal nntp server and I would like
So my company uses a delightfully buggy program called Rational Purify (as a plugin
I'm writing a script for Caseware, the accounting software my Company uses, and I
The company I work for uses an ASP.NET grid component from a commercial vendor,
The company I work for currently uses Go To Meeting to share our desktops

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.