private object Invoke(MethodInfo targetMethod, object[] args)
        {
            var config = GetConfig();

            if (!config.Enabled)
            {
                return(targetMethod.Invoke(DataSource, args));
            }

            if (MetadataProvider.IsCached(targetMethod))
            {
                return(Memoizer.Memoize(DataSource, targetMethod, args, new CacheItemPolicyEx(config)));
            }
            else
            {
                return(targetMethod.Invoke(DataSource, args));
            }
        }
예제 #2
0
 protected virtual bool IsMethodCached(MethodInfo targetMethod, object[] args)
 {
     return(MetadataProvider.IsCached(targetMethod));
 }