Пример #1
0
    public override void ClearCache()
    {
        try
        {
            // Here should be main method implementation.
            // It is empty as this method does nothing.
        }
        finally
        {
            if (_methodInfo1 == null)
            {
                _methodInfo1 =
                    ClearCacheAspect.GetMethodInfo(this, null, "CachedMethod", null);
            }

            CacheAspect.ClearCache(_methodInfo1);
        }
    }
Пример #2
0
    public override void ClearCache2()
    {
        try
        {
        }
        finally
        {
            if (_methodInfo2 == null)
            {
                _methodInfo2 = ClearCacheAspect.GetMethodInfo(
                    this,
                    null,
                    "CachedMethod",
                    new Type[] { typeof(int), typeof(int) });
            }

            CacheAspect.ClearCache(_methodInfo2);
        }
    }