Does Util.Cache() reliably cache the results of asynchronous functions?

edited January 23

Title. With this test, it does seem to work, but should I expect it to?

async Task Main()
    $"Running now: {DateTime.Now}".Dump();
    var date = await Util.Cache(async () => await GetDate(), "now");

    async Task<DateTime> GetDate()
        await Task.Delay(3000);
        return DateTime.Now;


Sign In or Register to comment.