...
public class AspNetCache : ICache
{
public T Get<T>(string key)
{
// this line (see below)
return (T)HttpContext.Current.Cache[key];
}
...
If the HttpContext.Current.Cache[key] is absent (null), would you not
rather:
return HttpContext.Current.Cache[key] as T; // will be null if
not castable instead of throwing exception
Perhaps even better
return HttpContext.Current.Cache.Get(key) as T; // if not
explicitly checking for presence.
Just a suggestion... Fantastic read so far,
Thanks!
Alan