0
fguo created
I noticed that most entity properties are defined as "public virtual ..." in Phonebook example and other code. As my understanding, "virtual" is for lazy loading or overwriting in derived classes. So, it is useful to define "virtual" on navigation properties (e.g. public virtual ICollection<Phone> Phones { get; set; }). What is the purpose to define all other entity properties as "virtual" (e.g. public virtual string Name { get; set; })? Does it effect performance on large DB tables?
Thanks,
1 Answer(s)
-
0
Hi @fguo,
It was required by NHibernate and we continued like this but you don't have to. It is not necessary for Entity Framework.
Thanks.