-
Notifications
You must be signed in to change notification settings - Fork 6
Lazy property loading
NerderyMGlanzer edited this page Mar 17, 2016
·
5 revisions
By default vault will eagerly map values from the underlying Umbraco document to your POCO. To avoid the overhead of performing this work on properties that will not be accessed you can opt-in to have Vault return proxy classes with lazy loading enabled.
To configure lazy loading via proxy classes configure like this during app start. (Technically can be done any time.)
ClassConstructor.SetInstanceFactory(new ProxyInstanceFactory());
Lazy loading will be enabled for all properties marked as virtual on your POCOs. Properties not marked virtual will be eager mapped as usual.