Goto the Cirrus Caching Aspect on Github.
You will need to download and install the Enterprise Library from the Microsoft Enterprise Patterns and Practices Library and in particular the Application Caching Block from Microsoft. You should consult the MSDN pages on the Caching Application Block for information on advanced configuration and usage.
Once you have installed this prerequisite, you can then download and compile the Aspect and add it as a reference to your project before adding Caching on a per-method basis like so:
MyClass = public class private public [Aspect:MethodCache] method CachedMethod: XmlDocument; method NotCachedMethod: XmlDocument;
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.