Open Closed

Properties defined as virtual by default, significance? #7055


User avatar
0
it@keystonecustomhome.com created

Abp Suite defines basic properties with the virtual keyword. normal convention says this is not necessary. Is there any particular significance to this in ABP? I may have noticed a performance hit since removing. Thank you

public string X {get; set;} vs public virtual string X {get; set;}


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The previous EF Core may need the virtual keyword.

    There is no need to make navigations virtual unless they are being used by lazy-loading or change-tracking proxies.

    It doesn't matter if you use it all the time.

  • User Avatar
    0
    it@keystonecustomhome.com created

    thank you for the clarification

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13