Hashing an IDbCommand
Suppose you're writing a generic data access layer (DAL) that executed a command and cached the results some place. You want that DAL to be smart enough to either execute the code and cache the results or just pull the results from the cache if it can. What could you use for a key on the cached object?
You may say that all you need is the command text, but that ignores that different parameters might generate different result sets, so you need to consider those too. However, its hard to serialize all of that out into a single string as key, right?
Answer Here