private static (string Key, MethodInfo Method, object Instance, object[] Arguments) ParseExpression([NotNull] LambdaExpression expression) { if (expression.Body is not MethodCallExpression methodCall) { throw new ArgumentNotMethodExpressionException(nameof(expression)); } MethodInfo method = methodCall.Method; object instance = methodCall.Object != null?GetValue(methodCall.Object) : null; object[] arguments = new object[methodCall.Arguments.Count]; KeyBuilder keyBuilder = new KeyBuilder(); keyBuilder.By(method.DeclaringType).By(method.MetadataToken).By(method.GetGenericArguments()).By(instance); for (int i = 0; i < methodCall.Arguments.Count; ++i) { keyBuilder.By(arguments[i] = GetValue(methodCall.Arguments[i])); } string cacheKey = keyBuilder.ToString(); return(cacheKey, method, instance, arguments); }