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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:52:00+00:00 2026-05-31T02:52:00+00:00

I have the following entities in Entity Framework: public class School { public int

  • 0

I have the following entities in Entity Framework:

public class School {
    public int Id { get; set; }
    public string SchoolName { get; set; }

    public virtual ICollection<Course> Courses { get; set; }
}

public class Course {
    public int Id { get; set; }
    public int SchoolId { get; set; }
    public string CourseName { get; set; }

    public virtual ICollection<Student> Students { get; set; }
    public virtual School School { get; set; }
}

public class Student {
    public int Id { get; set; }
    public string FullName { get; set; }

    public int Grade { get; set; }

    public int CourseId { get; set; }
    public virtual Course Course { get; set; }
}
  • Each school has many courses
  • Each course only belongs to one school
  • Each course has many students
  • Each student only belongs to one course

I have a specific page in my application that needs to summarize some information which you can see in this jsfiddle: http://jsfiddle.net/Jsf3f/

Basically I need to display the data in a table that rolls up the information. I need to show each school in its own line, which has the total number of students in all courses and the highest grade in all of those courses. I also need to display each course individually that also summarizes the information with the number of students enrolled in it and the highest grade of all students in the course.

In order to do this I am pretty sure I need to create new Domain classes that can summarize this information.

My questions:

To properly summarize this information would I create a repository that deals with returning a SchoolSummary object. Would SchoolSummary be considered an aggregate root in Domain Driven Design?

Do I instead try and create a different domain model and have the summary be only a view model that can easily translate the domain objects into summaries.

I think I am having trouble trying to visualize the domain layer vs just my database layer (Entity Framework) and presentation layer (MVC).

  • 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-31T02:52:02+00:00Added an answer on May 31, 2026 at 2:52 am

    Truth be told you can apply DDD in the rest of the app, but in this case you’re dealing only with queryies and reports. If you’re using CQRS (Command Query Responsability Separation) then basically you can create a simplified query model (parts of the view model itself) and a query repository which will serve them.

    So no need for AR, just a repository tailored for the reporting usage. About DDD, IMO is suitable just for commands (create and update model), but an app has both reads and writes so what is not a ‘write’ can be handled in a more simplistic way. In the end we apply a mindset where it’s needed in an app, we shouldn’t force an app to fit in a mindset.

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

Sidebar

Related Questions

I have the following to get data from an Entity Framework 4: IQueryable<Exam> examsQuery
I have class like the following: class test { public string Name; public string
I have the following hierarchy of objects in Entity Framework Code First: class Parent
I have following code public partial class MainWindow : Window { public MainWindow() {
I am using EF with the following definitions: public class StoredFile { public int
I have a question about Entity Framework and Linq to Entities. My .NET version
I have read this link :- RIA Services: Entity Framework Reference Entities and added
I have the following table structure which has been imported into the Entity Framework.
I am using Entity Framework 4.1 (code first) and have defined entities similar to
In a project that I am working on, I have the following entities: Analyst

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.