theflamme wrote:
What does have the virtual keyword has to do with the lazy loading?
NHibernate creates dynamically a inherited class, an overrides all virtual members. In those overrides, it checks if the data is loaded or not.
If any of public members is not virtual, the data might remain unloaded if the instance is used.
theflamme wrote:
does that make MyClass sealed since I didnt declare my property as virtual?
Sealed is C# keyword:
Code:
public sealed class Child
means that the class can not be inherited from.
theflamme wrote:
and if so, what's the difference for developper using my class and what's relating this with nhibernate?
If developer uses class, the virtual/non-virtual/selaed should not make difference. If he/she inherits from the class, the usual differences apply. (You can override virtual methods; You can not inherit from sealed class)
Gert