anchor.diff:              | Result
   
           ///Gets the return type of a method
  -        let getReturnType (method' : MethodInfo) = 
  +        let getReturnType = 
  +
  +            let cache = ConcurrentDictionary<MethodInfo, ReturnType> ()
  +
  +            let add (method' : MethodInfo) =
                       
  -            let returnType = 
  -                match (AsyncSupport.getAsyncReturnType method'.ReturnType) with
  -                | Some type' -> type'
  -                | _ -> method'.ReturnType
  +                let returnType = 
  +                    match (AsyncSupport.getAsyncReturnType method'.ReturnType) with
  +                    | Some type' -> type'
  +                    | _ -> method'.ReturnType
               
  -            let summary = 
  -                getTypeSummary returnType
  -
  -            if (isUnit summary.BaseType) then
  +                let summary = 
  +                    getTypeSummary returnType
  +
  +                if (isUnit summary.BaseType) then
                   
  -                Void
  -
  -            else if (isType<OperationResult> summary.BaseType) then
  -
  -                if summary.IsOptional then
  -                    invalidSetup "Optional OperationResult is not supported."
  -
  -                Result
  -
  -            else
  -
  -                Resource (summary.IsOptional, summary.BaseType)
  +                    Void
  +
  +                else if (isType<OperationResult> summary.BaseType) then
  +
  +                    if summary.IsOptional then
  +                        invalidSetup "Optional OperationResult is not supported."
  +
  +                    Result
  +
  +                else
  +
  +                    Resource (summary.IsOptional, summary.BaseType)
  +
  +            fun method' ->
  +                cache.GetOrAdd (method', add)
   
           ///Gets the invoke method for a function type
           let getFunctionInvokeMethod (type' : Type) = 
  
positive.code: ﻿namespace Slumber
  
  open System
  open Slumber.Framework
  
  ///Contains functions for generating Slumber configuration in a fluent style
  
negative.code:             | Metadata
  
          ///Gets the argument type for a given type
          let getArgumentType  = 
  
              let cache = ConcurrentDictionary<ParameterInfo, ArgumentType> ()
  
              let add (parameter : ParameterInfo) =
              
                  let summary = getTypeSummary parameter.ParameterType
  
                  if (isUnit summary.BaseType) then
  
                      Unit'
  
                  else if (isType<OperationMetadata> summary.BaseType) then
  
                      if summary.IsOptional then
                          invalidSetup "Optional OperationMetadata is not supported."
  
                      Metadata
  
                  else if (summary.BaseType.IsValueType || isType<String> summary.BaseType) then
  
                      Parameter (parameter.Name, summary.IsOptional, summary.BaseType)
  
                  else
  
                      Message (summary.IsOptional, summary.BaseType)
  
              fun parameter ->
                  cache.GetOrAdd (parameter, add)
  
          ///Gets the argument types for a given method
          let getArgumentTypes (method' : MethodInfo) = 
  