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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:33:35+00:00 2026-05-24T09:33:35+00:00

I am developing a web app for a non-profit. (The app registers laborers for

  • 0

I am developing a web app for a non-profit. (The app registers laborers for the day, tracks their personal info, takes work orders, and provides an interface to assign registered workers to a work order) I have about 8 tables in SQL Server. I started with Sanderson’s book on MVC and attempted to implement the patterns that he recommends: IoC, separation of concerns, DI…

Here are my Context definitions:

    public DbSet<Person> Persons { get; set; }
    public DbSet<Worker> Workers { get; set; } //All workers are persons, but not all persons are workers.       
    public DbSet<WorkerSignin> WorkerSignins { get; set; } //1 entry per worker, per day (barcode scanner)
    public DbSet<Image> Images { get; set; }
    public DbSet<Employer> Employers { get; set; }  //1 employer has many work orders
    public DbSet<WorkOrder> WorkOrders { get; set; }  //1 work order has many work assignments
    public DbSet<WorkAssignment> WorkAssignments { get; set; } //1 assignment -> space for worker
    public DbSet<WorkerRequest> WorkerRequests { get; set; }
    public DbSet<Lookup> Lookups { get; set; }    //configuration, dropdowns, other stuff

The app has been in production for a few months–the non-profit has temps entering past orders and data for reporting purposes, so the record volume is growing rapidly. They’re hitting some performance bottlenecks, and as I fix them, I’d like to fix them at the correct layer.

In multiple instances, I need to display information from multiple tables. Examples:

  1. The display of a Worker pulls first and last name from Person (using EF Collections)
  2. The display of a WorkerSignin pulls from Worker and Person
  3. The display of a WorkAssignment pulls from WorkOrder

So, in the case of #1, is it better to have my Worker service pull in the Person Service, or should the Worker Repository pull in the Person repository? Or, should I make a new Repository, like ‘CompleteWorker’ that combines information from both the Person and Worker table?

  • 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-24T09:33:36+00:00Added an answer on May 24, 2026 at 9:33 am

    Your repositories should not have knowledge of any entity other than the entity they operate on. Personally I have found the best way to handle this sort of scenario is to have my repository expose a method or property that returns an IQueryable so that I can perform joins in my service layer.

    So to answer your question, your Worker service would depend on both the Worker repository and the Person repository.

    Alternatively are your database and model setup such that you could simply use a projection or the Include method to retrieve the specific data you are looking for?

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

Sidebar

Related Questions

I'm developing web app that user can save his/her work to server. The data
I'm current developing web-app that allows a user to associate their account with their
im developing a web app to manager jobs, curriculum and etc... For example in
we're developing a web app to cover all aspects of a printing company from
I am developing a web app which requires a username and password to be
I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian
I'm developing a web app in Perl with some C as necessary for some
I am developing a web app for which I plan to use InnoDB. However
I'm developing a web app and currently using sql server 2008 for it. But,
I am developing a web app using servlets and jsps. I have a question

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.