From f544be04f8cb51bd8321bbc914e879a1d3f2ee8b Mon Sep 17 00:00:00 2001 From: Chebotov Nikolay Date: Fri, 21 Feb 2020 11:55:48 +0300 Subject: [PATCH] Replace Dictionary with IDictionary in ByKey method (dependent on the update to OData Client v7.6.3). --- CHANGELOG.md | 5 +++++ .../Properties/AssemblyInfo.cs | 4 ++-- .../Templates/ODataT4CodeGenerator.cs | 4 ++-- .../Templates/ODataT4CodeGenerator.ttinclude | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6f9e3d..311d049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ These are the changes to each version that has been released on the official [Visual Studio extension gallery](https://marketplace.visualstudio.com/items?itemName=unchase.UnchaseODataConnectedService). +## v1.4.1 `(2020-02-21)` + +- [x] Replace Dictionary with IDictionary in ByKey method + - [x] This fix is dependent on the update to OData Client v7.6.3 as done in this PR [OData/odata.net#1648](https://github.com/OData/odata.net/pull/1648) + ## v1.4.0 `(2020-02-20)` - [x] Add feature: allow making generated types internal to hide them outside the assembly diff --git a/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs b/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs index 71560b1..10b6f9a 100644 --- a/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs +++ b/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs @@ -30,7 +30,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.4.0.0")] -[assembly: AssemblyFileVersion("1.4.0.0")] +[assembly: AssemblyVersion("1.4.1.0")] +[assembly: AssemblyFileVersion("1.4.1.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.cs b/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.cs index b758912..ab3cbea 100644 --- a/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.cs +++ b/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.cs @@ -5235,7 +5235,7 @@ internal override void WriteByKeyMethods(string entityTypeName, string returnTyp this.Write(this.ToStringHelper.ToStringWithCulture(entityTypeName)); -this.Write("> _source, global::System.Collections.Generic.Dictionary keys)\r\n " + +this.Write("> _source, global::System.Collections.Generic.IDictionary keys)\r\n " + " {\r\n return new "); this.Write(this.ToStringHelper.ToStringWithCulture(returnTypeName)); @@ -5282,7 +5282,7 @@ internal override void WriteByKeyMethods(string entityTypeName, string returnTyp this.Write(this.ToStringHelper.ToStringWithCulture(keyParameters)); -this.Write(")\r\n {\r\n global::System.Collections.Generic.Dictionary keys = new global::System.Collections.Generic.Dictionary\r" + "\n {\r\n "); diff --git a/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.ttinclude b/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.ttinclude index d5bcac9..91f2821 100644 --- a/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.ttinclude +++ b/src/Unchase.OData.ConnectedService/Templates/ODataT4CodeGenerator.ttinclude @@ -4351,7 +4351,7 @@ namespace <#= fullNamespace #> /// /// source entity set /// dictionary with the names and values of keys - public static <#= returnTypeName #> ByKey(this global::Microsoft.OData.Client.DataServiceQuery<<#= entityTypeName #>> source, global::System.Collections.Generic.Dictionary keys) + public static <#= returnTypeName #> ByKey(this global::Microsoft.OData.Client.DataServiceQuery<<#= entityTypeName #>> source, global::System.Collections.Generic.IDictionary keys) { return new <#= returnTypeName #>(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys))); } @@ -4370,7 +4370,7 @@ namespace <#= fullNamespace #> public static <#= returnTypeName #> ByKey(this global::Microsoft.OData.Client.DataServiceQuery<<#= entityTypeName #>> source, <#= keyParameters #>) { - global::System.Collections.Generic.Dictionary keys = new global::System.Collections.Generic.Dictionary + global::System.Collections.Generic.Dictionary keys = new global::System.Collections.Generic.IDictionary { <#= keyDictionaryItems #> };