Skip to content

Commit

Permalink
Remove unused paramater
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhg committed Jul 28, 2022
1 parent 038ef9c commit 07e1196
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2128,16 +2128,7 @@ public static IEnumerable<IDictionary<string, IEdmProperty>> GetAlternateKeysAnn
IEdmEntityType checkingType = type;
while (checkingType != null)
{
// Check the core version first
IEnumerable<IDictionary<string, IEdmProperty>> 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<IDictionary<string, IEdmProperty>> declaredAlternateKeys = GetDeclaredAlternateKeysForType(checkingType, model);
if (declaredAlternateKeys != null)
{
return declaredAlternateKeys;
Expand Down Expand Up @@ -3435,7 +3426,7 @@ internal static bool HasAny<T>(this IEnumerable<T> enumerable) where T : class
/// <param name="type">Reference to the calling object.</param>
/// <param name="model">The model to be used.</param>
/// <returns>Alternate Keys of this type.</returns>
private static IEnumerable<IDictionary<string, IEdmProperty>> GetDeclaredAlternateKeysForType(IEdmEntityType type, IEdmModel model, bool useCore = false)
private static IEnumerable<IDictionary<string, IEdmProperty>> GetDeclaredAlternateKeysForType(IEdmEntityType type, IEdmModel model)
{
IEdmVocabularyAnnotation annotationValue = model.FindVocabularyAnnotations<IEdmVocabularyAnnotation>(type, AlternateKeysVocabularyModel.AlternateKeysTerm).FirstOrDefault();
IEdmVocabularyAnnotation coreAnnotationValue = model.FindVocabularyAnnotations<IEdmVocabularyAnnotation>(type, CoreVocabularyModel.AlternateKeysTerm).FirstOrDefault();
Expand Down Expand Up @@ -3484,6 +3475,7 @@ private static IEnumerable<IDictionary<string, IEdmProperty>> GetDeclaredAlterna
}
};

// For back-compability, we merge the alternate keys from community and core vocabulary annotations if have.
retrieveAnnotationAction(annotationValue);
retrieveAnnotationAction(coreAnnotationValue);

Expand Down

0 comments on commit 07e1196

Please sign in to comment.