Defer loading of Lazy<T> types in Results View
Don't evaluate Lazy<T>.Value in Results view. Allow it to be loaded by user interaction.
3
votes
Maxwell Bloch
shared this idea
Done in latest beta. www.linqpad.net/beta.aspx
-
Maxwell Bloch commented
new {
value = new Lazy<string>(() => { Thread.Sleep(10000); return "Test"; })
}.Dump();:-)
-
Maxwell Bloch commented
Looks great!
-
Maxwell Bloch commented
Thanks. Though, thinking about it, user interaction may not be viable unless you leave the script running and dormant. I have a few thoughts on that, then. The easiest thing might be provide an option not to load them.