umco / umbraco-ditto

Ditto - the friendly view-model mapper for Umbraco
http://our.umbraco.org/projects/developer-tools/ditto
MIT License
79 stars 33 forks source link

DittoLazy attribute #191

Closed mattbrailsford closed 8 years ago

mattbrailsford commented 8 years ago

As discussed in #190, adding a DittoLazy attribute to be explicit about which properties are Lazy loaded.

@JimBobSquarePants can you check at line 385 that this is ok? In the original code, virtual props were made first, and this code ran, THEN non virtual property values were set. Should this be ok that all properties are set first lazy and non lazy, and THEN the proxy object is created?

Still need to do some unit tests

mattbrailsford commented 8 years ago

Thanks @JimBobSquarePants. We don't have the global register / global flag yet, but should be easy enough to add.

mattbrailsford commented 8 years ago

Added some starter unit tests but I could do with some advice from @JimBobSquarePants as to how we can verify in code that a given property has an interceptor registered?

JimBobSquarePants commented 8 years ago

@mattbrailsford You should be able to check whether the result implements IProxy

mattbrailsford commented 8 years ago

Yea, currently doing that, but no easy way to "check" which properties are setup to be proxied.