-
Notifications
You must be signed in to change notification settings - Fork 352
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
Adding first stage Alternate Key Support #219
Conversation
Alternate Keys first stage Implementation, with all build issues and warnings fixed. Added unit tests.
Adding unit test
Hi @abkmr, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@abkmr, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
Allowing correct exception handling for composite alternate keys.
@@ -1597,6 +1597,95 @@ public static IEnumerable<IEdmStructuralProperty> Key(this IEdmEntityType type) | |||
} | |||
|
|||
/// <summary> | |||
/// Gets the declared alternate keys of the most defined entity with a declared key present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these extension methods to the server library: OData Web API, or create a new set of API. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is dependency from the ODL library code for these extensions, hence they need to be in ODL.
Unit tests fixes. Code cleanup. Adding fix for enum as string in key.
Fixing unit test failures
Removing warnings
using Microsoft.OData.Edm.Validation; | ||
|
||
|
||
namespace Microsoft.OData.Edm.Vocabularies.V1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft.OData.Edm.Vocabularies.Community.V1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
Add edm test cases for alternate key.
…nit tests. Addressing review comments. Updating namespace for alt keys. Fixing unit tests.
…d type AlternateKeysOdataUriResolver. Removing Alternate Key changes from ODataUriResolver. Creating derived type AlternateKeysODataUriResolver. Unit test fixes.
book.AddKeys(prop1); | ||
book.AddAlternateKey(model, new Dictionary<string, IEdmProperty> { { "s2", prop2 } }); | ||
book.AddAlternateKey(model, new Dictionary<string, IEdmProperty> { { "s3", prop3 }, { "s4", prop4 } }); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
Code review comments, fixes.
For alternate key Protocol, Please refer to: OData/vocabularies#9
Merged the PR. Thanks. |
Do you know when these changes will make it to the nuget package? |
Hi Don. These changes are available through the nightly builds of odata Libraries that you can get from https://www.myget.org/gallery/odlnightly. They will also be part of 6.13 release for ODL. |
Thanks, Abhishek. Do you know how I would use these changes with a model built using ODataConventionModelBuilder? I'm not sure how to get from there to an IEdmEntityType. |
For alternate key Protocol, Please refer to: OData/vocabularies#9
first stage implementations with unit test for Alternate Keys.
Added Alternate Keys vocabulary definitions, as per vocabulary spec defined on the alternate key vocabulary.
Added Extensions to IEdmEntityType Definition, to allow for creation and retrieval of alternate keys with corresponding aliases for each structural attribute
Added AlternateKey binding and resolution support based upon what the corresponding model contains for the given