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

CodeGen support for emitting dynamic properties on open types #1436

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

Conversation

BerserkerDotNet
Copy link

Issues

This pull request fixes issue #1398.

Description

Modified OData client generator T4 templates to generate a dictionary for OpenType types.
For example, for the following CSDL:

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
  <edmx:DataServices>
    <Schema Namespace="OpenTypeRepro" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <ComplexType Name="MyOpenType" OpenType="true" />
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>

The proxy will conatain DynamicProperties property:

        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("")]
        public global::System.Collections.Generic.Dictionary<string, object> DynamicProperties
        {
            get
            {
                return this._DynamicProperties;
            }
            set
            {
                this.OnDynamicPropertiesChanging(value);
                this._DynamicProperties = value;
                this.OnDynamicPropertiesChanged();
                this.OnPropertyChanged("");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
        private global::System.Collections.Generic.Dictionary<string, object> _DynamicProperties = new global::System.Collections.Generic.Dictionary<string, object>();
        partial void OnDynamicPropertiesChanging(global::System.Collections.Generic.Dictionary<string, object> value);
        partial void OnDynamicPropertiesChanged();

@msftclas
Copy link

msftclas commented Mar 29, 2019

CLA assistant check
All CLA requirements met.

@KanishManuja-MS
Copy link
Contributor

@BerserkerDotNet Thanks for your contribution. The following test cases are failing -
image

@xuzhg xuzhg requested review from KanishManuja-MS and xuzhg April 24, 2019 20:45
@aboryczko
Copy link

Hi, any updates on this issue?

@xuzhg xuzhg added this to the 7.6.1 milestone Jul 3, 2019
@xuzhg xuzhg requested a review from mikepizzo July 3, 2019 20:40
@xuzhg xuzhg added the Ready for review Use this label if a pull request is ready to be reviewed label Jul 3, 2019
@madansr7
Copy link
Contributor

@BerserkerDotNet Hi, Is there any updates?

@madansr7 madansr7 added client only related to OData.Client follow-up and removed Ready for review Use this label if a pull request is ready to be reviewed labels Aug 21, 2019
@madansr7
Copy link
Contributor

madansr7 commented Sep 4, 2019

@BerserkerDotNet , we would like to pick this up in our next release of client code gen. Could you please rebase and add the requested tests. Let us know if you have any questions or concerns.

@xuzhg xuzhg force-pushed the master branch 2 times, most recently from f9519fd to 14a4b12 Compare September 22, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client only related to OData.Client follow-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants