odata.net
odata.net copied to clipboard
CodeGen support for emitting dynamic properties on open types
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();
@BerserkerDotNet Thanks for your contribution. The following test cases are failing -
Hi, any updates on this issue?
@BerserkerDotNet Hi, Is there any updates?
@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.