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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:21:27+00:00 2026-06-05T11:21:27+00:00

I work with EF for the first time so I don’t know is situation

  • 0

I work with EF for the first time so I don’t know is situation like this normal or I have serious performance issues.
I have following situation:

Bellow are the classes that I have. Item is the main object here. So when I pull a list of Items from database I get for example 1000 items. And now each of this item has all properties filed with data. City contains Country, Country contains list of cities, User has list of created items, each item all data again, city, city has country, country list of cities etc etc…
Maybe I am worrying too much and I don’t know should this object’s contain all those data and does this make performance issues, or I am doing something wrong here?

public abstract class Item
    {
        [Key]
        public int ItemId { get; set; }

        public int ItemTypeId { get; set; }
        public Guid UserId { get; set; }
        public DateTime CreatedOnDate { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public int? MediaId { get; set; }
        public int CityId { get; set; }
        public virtual City City { get; set; }
        public virtual User User { get; set; }
        public virtual ICollection<ItemInBoard> ItemsInBoard { get; set; }
        public virtual ICollection<Like> Likes { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }        
    }
public class City
    {
        public int CityId { get; set; }
        public string Name { get; set; }
        public double Longitude { get; set; }
        public double Latitude { get; set; }
        public int CountryId { get; set; }
        public virtual Country Country { get; set; }
    }
public class Country
    {
        public int CountryId { get; set; }
        public string Name { get; set; }
        public string CountryCode { get; set; }
        public virtual ICollection<City> Cities { get; set; }
    }
public class User
    {
        public Guid UserId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public bool Gender { get; set; }
        public DateTime? BirthDay { get; set; }
        public string AboutMe { get; set; }
        public int? MediaId { get; set; }
        public int CityId { get; set; }
        public virtual City City { get; set; }
        public virtual ICollection<Item> Items { get; set; }
        public virtual ICollection<Board> Boards { get; set; }
        public virtual ICollection<Like> Likes { get; set; }
    }
  • 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-05T11:21:30+00:00Added an answer on June 5, 2026 at 11:21 am

    It is up to you. This is a concept called lazy loading. You can enable or disable lazy loading with this code:

      context.Configuration.LazyLoadingEnabled = false;
      context.Configuration.LazyLoadingEnabled = true;
    

    When enabling this option none of the dependent entities will be loaded. To enforce dependent entities to load you can use the Include lambada expression like this:

       var test = context.Tests.Include("SomeOtherDependentEntity");
    

    Hope I got you and this is what you meant.

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

Sidebar

Related Questions

Hey this is my first time trying anything like so I don't know if
So this is my first time I have to work with the IPad camera
This is my first time using jquery, and I don't know why this simple
this is my first time to work with API's in PHP, so please bear
I will start by saying this is the first time I have done anything
It is the first time I work with this kind of application. Very little
I just got my ssl certificate to work for the first time. For some
First off tags wont work. I say this because i create 4 buttons all
js doesn't work if I don't refresh the page after first load,and div's background-img
This is my first time that I am working on a big project for

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.