Thank you for this post.
Actually, the return type of Get method is IEnumerable and there is a compilation error when we return cachedWeatherResult which is string.
How can cachedWeatherResult be converted to the correct return type?
The return method of Get method is a task of IEnumerable. To get the correct return type for cached result, the sample uses GetCacheValueAsync() method which does the conversion using JsonConvert deserialization.
Thank you for this post.
Actually, the return type of Get method is IEnumerable and there is a compilation error when we return cachedWeatherResult which is string.
How can cachedWeatherResult be converted to the correct return type?
Hello Amiradelli,
The return method of Get method is a task of IEnumerable. To get the correct return type for cached result, the sample uses GetCacheValueAsync() method which does the conversion using JsonConvert deserialization.
Here is a link to the implementation on GitHub: github.com/samtimberlan/Distribute...