using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Wabbajack { public class AsyncLazy : Lazy> { public AsyncLazy(Func valueFactory) : base(() => Task.Factory.StartNew(valueFactory)) { } public AsyncLazy(Func> taskFactory) : base(() => Task.Factory.StartNew(() => taskFactory()).Unwrap()) { } } }