打开 关闭

Properties defined as virtual by default, significance? #7055


User avatar
0
it@keystonecustomhome.com 创建

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 答案
  • User Avatar
    0
    maliming 创建
    支持团队 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 创建

    thank you for the clarification

Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11