下面的 C# 代码
public async Task<T> GetValueOrCreateAsync<T>(string key, Func<T> factory) { //.. var value = await factory(); }
编译时会报错
CS1061 'Func<T>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'Func<T>' could be found (are you missing a using directive or an assembly reference?)
慕哥9229398
相关分类