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

The Archive Base Latest Questions

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

Refer to the EntityFramework article, and other ASP MVC webinars from Microsoft such as;

  • 0

Refer to the EntityFramework article, and other ASP MVC webinars from Microsoft such as;

1: http://www.asp.net/mvc/videos/5-minute-introduction-to-aspnet-mvc

2: http://blogs.msdn.com/b/adonet/archive/2011/03/08/ef-feature-ctp5-code-first-model-with-master-detail-wpf-application.aspx

They use virtual keyword to reference between master and detail models.

Could you explain (1) why they use virtual keyword and (2) what drawbacks occur without the keyword?

Regards

  • 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-24T21:29:20+00:00Added an answer on May 24, 2026 at 9:29 pm

    They specify why in your second link:

    When using POCO entity types, lazy loading is achieved by creating instances of derived proxy types during runtime and then overriding virtual properties to add the loading hook. To get lazy loading of related objects, you must declare navigation property getters as public, virtual (Overridable in Visual Basic), and not sealed (NotOverridable in Visual Basic). In the code above, the Category.Products and Product.Category navigation properties are virtual.

    The only downside I can see is that, like any virtual method, these will perform ever so slightly slower than a non-virtual method. Chances are you will never be able to detect the performance difference.

    You will see a delay in the first access of these properties, as lazy loading implies that the first read will result in a DB query.

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

Sidebar

Related Questions

Refer to Good and full implementation of RSS feeds in ASP.net MVC Check the
Please refer to http://jsfiddle.net/7FfMd/6/ run the code, then select E from the drop down,
Please refer to the topic http://www.codeproject.com/KB/viewstate/SaveViewState.aspx . The topic demonstrates how you can save
Please refer to http://jsfiddle.net/UEePE/1025/ for the x-axis, when I don't want to skip any
Please refer to http://www.contempo.org.mo/Online%20magazine/ISSUE21/index.htm Is there any open source or other tools can accomplish
To refer to the root of a website in asp I use an ASP
I've been reading updates on Data Sets vs. Other ORM's like ADO.NET Entity Framework,
Please refer to http://lrin.tk/float_problem.htm . Here's how my page looks like: +-----------------------+ +---------------------------+ +--------------+
I have the following tag in my ASP.NET Web.config application: <add name=monitorEntities connectionString=metadata=res://*/Models.MonitorDB.csdl|res://*/Models.MonitorDB.ssdl|res://*/Models.MonitorDB.msl;provider=System.Data.SQLite;provider connection
Please refer to this page for reference: http://loadedgranola.valitics.com/_product_83484/blackberry_lime I have a jQuery script that

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.