I have a class which contains a generic dictionary:
protected Dictionary<K,T> Data { get; set;}
I wish to allow clients of this class to perform LINQ queries without having to return the Dictionary. I had look at AsQueryable() but that doesn’t seems to do what I wish.
An example of the code I would like to write would be:
typeRepo.Query().Where( x => x.name == "wire")
It seems like the dictionary is holding a model (T) by its key (K). The code you’ll need is: