Yes... We do know what a method looks like...
I guess you want to save the results of an expensive operation, so you don't
have to recalculate its value if it gets called again with the same
parameters?
If so, use a HashTable to store the calculation results, and check if you
have an old result in the table before calculating a new one.
Niki
"Jane204" <ke********@yahoo.com> wrote in
news:ba**************************@posting.google.c om...
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in message
news:<MP************************@msnews.microsoft. com>...
Jane204 <ke********@yahoo.com> wrote: How to cache a generic method (not a webmethod) within a class?
What exactly do you mean? Can you give an example of what you want?
Hi,
class Test{
// I want to cache just the following method
void foo(){
// do something
}
}
Thanks.
Jane