'System.Collections.Generic.IEnumerable<string>' does not contain a definition for 'ToList' and the best extension method overload 'ServiceStack.EnumExtensions.ToList(System.Enum)' has some invalid arguments
and, I think, a related one to the above:
Instance argument: cannot convert from 'System.Collections.Generic.IEnumerable<string>' to 'System.Enum'
The line is:
var sessionKeys = cache.GetKeysStartingWith(sessionPattern).ToList();
That’s because IEnumerable.ToList() extension method is in the System.Linq namespace. You should really consider getting a tool like ReSharper which automatically resolve missing namespaces for you as you’re getting basic namespace errors I’ve not seen in years. I’ve not tried it without R# but I’m surprised vanilla VS.NET 2015 would still have issues with missing namespaces.
Oh god! I trusted VS.NET IntelliSense… but it didn’t give me any hint in this case!
I didn’t know about R#, I will try it for sure!
Thank you Demis you always teach me something!
Have you registered an ICacheClient in the Container at this point? If not then HostContext.TryResolve<ICacheClient>() is going to resolve into a null instance.
You can change it so it tries to resolve the ICacheClient at the time it’s resolved with:
container.Register(c => new CacheSessions(c.Resolve<ICacheClient>()));
I think you should try debugging first, this seems like a trivial error that could’ve been easily identified with a break point in the constructor.