1

This question is somehow related to one that I found here. In order to avoid round trip to the database I am caching the database output but in case of a null value, asp.net cannot make the difference between a value not set and an actual NULL value. I was wondering if instead of checking for the cache value for a specified key , we could check if a key is in the cache . Maybe there is a way to get what keys are in the cache instead of looking for values. If not I would like to know how you would typically cache such data or if in fact caching it makes no sense. Thank you.

Community
  • 1
  • 1
ak3nat0n
  • 6,060
  • 6
  • 36
  • 59

1 Answers1

1

I suggest you access the cache through your own wrapper function that converts a null into a DBNull.Value before storing.

Christian Hayter
  • 30,581
  • 6
  • 72
  • 99