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

Added a "cacheable" lazy check of the debug mode #198

Closed tompipe closed 8 years ago

tompipe commented 8 years ago

Added a "cacheable" lazy check of the debug mode check

mattbrailsford commented 8 years ago

Can you explain the reason? What issue is it fixing?

JimBobSquarePants commented 8 years ago

Reading configuration values from the web.config is lazy and one time anyway as far as I'm aware. I'm not convinced the ResettableLazy<TValue>.Reset() method is threadsafe either.

tompipe commented 8 years ago

Ah you're right! I need to stop coding crazy ideas at 3am, or at least give them more thought! 😂

mattbrailsford commented 8 years ago

Gonna close this PR then, thanks anyways :)

tompipe commented 8 years ago

No worries, I saw Lee's TODO whilst I had the solution open anyway, and thought i'd try help out.

mattbrailsford commented 8 years ago

@tompipe your help is always welcome :)

leekelleher commented 8 years ago

Me and my TODO notes eh? (it'll be my downfall)

I think I added the note as we were calling AppSettings["Ditto:DebugEnabled"] twice, but I wasn't sure if that could be optimised on our side? (But going from @JimBobSquarePants's comment above, I've read up about it now and .NET does cache it already).

I'll remove the TODO note 😉