From 07e1196f4ef637b4907b5f1195e638eb9dbf0bc5 Mon Sep 17 00:00:00 2001 From: Sam Xu Date: Thu, 28 Jul 2022 13:46:24 -0700 Subject: [PATCH] Remove unused paramater --- .../ExtensionMethods/ExtensionMethods.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs b/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs index c3880c65e4..89f6cc2281 100644 --- a/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs +++ b/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs @@ -2128,16 +2128,7 @@ public static IEnumerable> GetAlternateKeysAnn IEdmEntityType checkingType = type; while (checkingType != null) { - // Check the core version first - IEnumerable> declaredAlternateKeys = GetDeclaredAlternateKeysForType(checkingType, model, true); - if (declaredAlternateKeys != null) - { - return declaredAlternateKeys; - } - - // for back-compability, check the community version second. - // Please remove the community version in the ODL 8 - declaredAlternateKeys = GetDeclaredAlternateKeysForType(checkingType, model); + IEnumerable> declaredAlternateKeys = GetDeclaredAlternateKeysForType(checkingType, model); if (declaredAlternateKeys != null) { return declaredAlternateKeys; @@ -3435,7 +3426,7 @@ internal static bool HasAny(this IEnumerable enumerable) where T : class /// Reference to the calling object. /// The model to be used. /// Alternate Keys of this type. - private static IEnumerable> GetDeclaredAlternateKeysForType(IEdmEntityType type, IEdmModel model, bool useCore = false) + private static IEnumerable> GetDeclaredAlternateKeysForType(IEdmEntityType type, IEdmModel model) { IEdmVocabularyAnnotation annotationValue = model.FindVocabularyAnnotations(type, AlternateKeysVocabularyModel.AlternateKeysTerm).FirstOrDefault(); IEdmVocabularyAnnotation coreAnnotationValue = model.FindVocabularyAnnotations(type, CoreVocabularyModel.AlternateKeysTerm).FirstOrDefault(); @@ -3484,6 +3475,7 @@ private static IEnumerable> GetDeclaredAlterna } }; + // For back-compability, we merge the alternate keys from community and core vocabulary annotations if have. retrieveAnnotationAction(annotationValue); retrieveAnnotationAction(coreAnnotationValue);