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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:37:16+00:00 2026-06-09T02:37:16+00:00

[This blog post titled: ‘ Passing multiple Include statements into a Repository ‘ provides

  • 0

[This blog post titled: ‘Passing multiple Include statements into a Repository‘ provides a great overview of how to control the depth of loaded children when hydrating an EF dbContext-based object. A very nice explanation of feeding the repository with Linq expressions.

But the blog leaves hanging a question that would really round out the workflow involved by explaining how thing look in the Controller itself.

If thin controllers are generally agree to be a good thing, and if EF is maturing to the point of mainstream usage, what pattern best mediates between the repository and controller?

George phrases the question better:

This is perfect, but then how does
one write the controller to handle all the different ways an object
and it’s children want to be requested? Is it a matter of creating an
CustomerOrderController and a CustomerOrderLineItemsController?

NOTE: This link is auto-offered by SO and probably addresses the ‘How to execute‘ – I’m still needing an overview of the syntax to be used.

mnymnythx

  • 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-09T02:37:17+00:00Added an answer on June 9, 2026 at 2:37 am

    Have you considered using a generic repository?

    The article goes a bit furthur than you’re wanting which might be good, in implementing a unit of work pattern. Your tags include MVC so I do recommend you use this to help keep all of your repos and objects synced up.

    Then, in an action in your controller you can choose which properties needed to be included:

     private UnitOfWork _unitOfWork;
    
            public YourController()
            {
                _unitOfWork = new UnitOfWork();
            }
            //
            // GET: /Market/
            public ActionResult Index()
            {
                return View(_unit.YourRepository.Get(m => m.IsActive, null, "CollectionToLoad1,CollectionToLoad2"));
            }
    

    In this example, I would get every item that has the IsActive bit as true, as well as including CollectionToLoad1 and CollectionToLoad2

    If you don’t want to implement a unit of work, you can simple declare the repo in the controller rather than the unit, and make the call directly.

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

Sidebar

Related Questions

This blog post of December 2008 says that rubygems is broken on Debian-based systems.
On this blog post , it's said that the minimum memory usage of a
Just finished reading this blog post: http://www.skorks.com/2010/03/an-interview-question-that-prints-out-its-own-source-code-in-ruby/ In it, the author argues the case
While browsing I came across this blog post about using the Wikipedia API from
I read at a few places (in the doc and in this blog post
As suggested by (among others) Kazi Manzur Rashid in this blog post , I
Should be an easy one. I thought, from reading this blog post that I
In this reddit blog post , the author talks about MD5ing the cache keys
Both domain.com/blog/post/2011/01/25/This-Is-The-Post-Title!.aspx domain.com/blog/post/2011/01/25/This-Is-The-Post-Title.aspx need to be redirected to domain.com/blog/2011/01/25/this-is-the-post-title The following rule works for
trying to figure out how to rewrite this url clientside blog.com/post/how-to-get-the-ladies to point serverside

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.