Hi folks,
I've got two items in my cache
- Key: Cat
- Key: Animal_Vacinations
Now, Animal_Vacinations
has a key-based cache dependency on Cat
. So, if anything changes for the cache item Cat
, then the cache item Animal_Vacinations
get invalidated. PERFECT :)
Ok.. now to the problem.
After i create the 2nd cache item (ie. Animal_Vacinations
) I add a 3rd cache object :-
- Key: Dog
Problem is, the 2nd object needs to have a dependency on Dog
also. At the time of creating the 2nd object, it knows what items it should depend on. So in this example the Animal_Vacination object knows it's should be dependant on ...
- Cat
- Dog
- Bird
- Jon Skeet
Problem is, if i try and insert the Animal_Vacination
object into the cache with all those 4 dependencies, it fails. No error, just fails. (ie. the Cache["Animal_Vacination"] == null
).
The reason for this, is, when i insert the cache object with those 4 dependencies ... *but 1 or more of those dependencies do not exist* ... it fails gracefully.
bummer.
because in my example above, one of those missing three objects is added right after the 2 object is added.
So ... is there anyway to add an object to a cache, with key-based cache dependencies, where 1 or more dependencies are not yet created but MIGHT be created later on?