Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional annotation location parameter to AddVocabularyAnnotation #1941

Open
wants to merge 3 commits into
base: release-7.x
Choose a base branch
from

Conversation

chrisspre
Copy link
Contributor

Issues

This pull request fixes issue #xxx.

Description

Briefly describe the changes of this pull request.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

/// <param name="model">The model the annotation is added to.</param>
/// <param name="annotation">The annotation to be added.</param>
/// <param name="location">The location to add the allocation</param>
public static void AddVocabularyAnnotation(this EdmModel model, IEdmVocabularyAnnotation annotation, Csdl.EdmVocabularyAnnotationSerializationLocation location)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IEdmVocabularyAnnotation annotation, Csdl.EdmVocabularyAnnotationSerializationLocation location [](start = 72, length = 95)

It's not a deal for me to add such extensions. Because, there's only two line codes .

but, i have a question here: How can handle this scenario:

annotation itself has the Location setting, and that setting is different with the "location" given?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware the IEdmVocabularyAnnotation has a location. Will look into it.

/// <param name="model">The model the annotation is added to.</param>
/// <param name="annotation">The annotation to be added.</param>
/// <param name="location">The location to add the allocation</param>
public static void AddVocabularyAnnotation(this EdmModel model, IEdmVocabularyAnnotation annotation, Csdl.EdmVocabularyAnnotationSerializationLocation location)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It's probably be good to add the Csdl namespace with a using statement

public static void AddVocabularyAnnotation(this EdmModel model, IEdmVocabularyAnnotation annotation, Csdl.EdmVocabularyAnnotationSerializationLocation location)
{
model.AddVocabularyAnnotation(annotation);
annotation.SetSerializationLocation(model, location);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to see a unit test for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants