If I had a CarsDataStore representing a table something like:
Cars
--------------
Ford | Fiesta
Ford | Escort
Ford | Orion
Fiat | Uno
Fiat | Panda
Then I could do
IEnumerable<Cars> fords = CarsDataStore["Ford"];
Is this a bad idea? It’s inconsistent with the other datastore objects in my api (which all have a single column PK indexer), and I’m guessing most people don’t expect an indexer to return a collection in this situation.
I wouldn’t expect an indexer to return a collection but then the compiler would tell me that if I ran into any problems.
However I would personally implement something more along the lines of