Fix missing ContainerProperty attribute on dynamic properties (issue #380)#381
Fix missing ContainerProperty attribute on dynamic properties (issue #380)#381habbes merged 4 commits intoOData:masterfrom
Conversation
|
@microsoft-github-policy-service agree |
|
Could you kindly share in the description what the issue is exactly and what the solution hopes to achieve? |
|
@wachugamaina I hope this is enough. |
|
@stanb thanks for this PR. Using lexical comparison was definitely a strange choice. Would you mind rebasing this PR with the @gathogojr could you check why the pipeline is failing? |
This reverts commit c9c79bb.
|
@habbes done |
|
Hey @stanb. Your code change won't give you the outcome you expect. Change: return Version.Parse(reference.Version) >= Version.Parse("7.6.4.0");to return Version.Parse(reference.Version) > Version.Parse("7.6.4.0"); |
@habbes The rebase is what was needed. It had |
|
@gathogojr fixed |
| if (reference.Name.Equals("Microsoft.OData.Client", StringComparison.Ordinal)) | ||
| { | ||
| return true; | ||
| return Version.Parse(reference.Version) > Version.Parse("7.6.4.0"); |
There was a problem hiding this comment.
Can we have a parsing exception here? or reference.Version will always be in the required format?
There was a problem hiding this comment.
Especially because the reference is for a library we maintain, plus this statement is in within the block
if (reference.Name.Equals("Microsoft.OData.Client", StringComparison.Ordinal))I think this should be safe.
In addition, we currently update the Microsoft.OData.Client reference manually.
Issues
This pull request fixes issue #380
When entity is an open type (
<EntityType Name="ResultObject" OpenType="true">) VS extension generatesIDictionary<string, object> DynamicPropertiesproperty.This property must have
ContainerPropertyattribute.Otherwise, when connected service is used, the dictionary is not populated from response.
If in the project, referenced
Microsoft.OData.Clientnuget with version >= 7.10.*,ContainerPropertyattribute not added due to wrong versions comparison.If I reference
Microsoft.OData.Clientversion 7.20.0, theContainerPropertyattribute not added because lexically 7.20.0 < 7.6.4Description
Fix
Microsoft.OData.Clientversions comparison.