Resolve ContentID in odata.bind annotation - #643
Conversation
|
@gathogojr is this valid |
| Uri resolvedId = id; | ||
|
|
||
| string idOriginalString = id.OriginalString; | ||
| if (ContentIdReferencePattern.IsMatch(idOriginalString)) |
There was a problem hiding this comment.
is this Regex Matching? Is it possible to use substring or indexOf to do the matching instead of Regex. I remember some discussions where this Regex was being discouraged because of performance reasons.
There was a problem hiding this comment.
@ElizabethOkerio We use similar logic in ODataMessageWrapper class. We're looking for a very particular pattern here - a $ followed by an integer. I think using Substring and Index would result into more complex logic
There was a problem hiding this comment.
On an unrelated note, let's avoid substring in favor Span<char>.Slice() where possible, to avoid string allocations.
@ElizabethOkerio Yes. Consider the sample payload below that the customer provided on the issue. You should be able to establish a parent-child relationship in the manner illustrated |
Issues
This pull request fixes OData/odata.net#2442.
Description
Resolve ContentID in odata.bind annotation
Checklist (Uncheck if it is not completed)
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.