Esempio n. 1
0
 private static string GetMetadataStringValue(ParameterObject parameter, string metadataName)
 {
     object metadataValue;
     if (parameter.Metadata.TryGetValue(metadataName, out metadataValue))
     {
         return (string)metadataValue;
     }
     return null;
 }
Esempio n. 2
0
 /// <summary>
 /// Judge whether two ParameterObject equal to each other. according to value of 'name' and 'in'
 /// Define 'Equals' here instead of inside ParameterObject, since ParameterObject is either self defined or referenced object which 'name' and 'in' needs to be resolved.
 /// </summary>
 /// <param name="left">Fist ParameterObject</param>
 /// <param name="right">Second ParameterObject</param>
 private static bool IsParameterEquals(ParameterObject left, ParameterObject right)
 {
     if (left == null || right == null)
     {
         return false;
     }
     return string.Equals(left.Name, right.Name) &&
            string.Equals(GetMetadataStringValue(left, "in"), GetMetadataStringValue(right, "in"));
 }