Skip to content

Commit

Permalink
1) Added minor fix: in "SimpleOData" generation methods added @-sym…
Browse files Browse the repository at this point in the history
…bol before the endpoint uri in `new ODataClient(@"<enpoint_uri>")`;

2) Bounded parameter type was fixed.
  • Loading branch information
unchase committed Apr 16, 2019
1 parent d5d3593 commit bfef4c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

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).

## v0.4.4 `(2019-04-16)`

- [x] Added minor fix: in `SimpleOData` generation methods added `@`-symbol before the endpoint uri in `new ODataClient(@"<enpoint_uri>")`; bounded parameter type was fixed

## v0.4.3 `(2019-04-14)`

- [x] Changed [`LICENSE`](LICENSE.md): [MIT License](https://mit-license.org) to [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ If you like what I am doing and you would like to thank me, please consider [buy

----------

Copyright &copy; 2019 [Nikolay Chebotov (**Unchase**)](https://github.com/unchase) - Provided under the [MIT License](LICENSE.md).
Copyright &copy; 2019 [Nikolay Chebotov (**Unchase**)](https://github.com/unchase) - Provided under the [Apache License 2.0](LICENSE.md).
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private static string GetFunctionMethodRegionWithSimpleOdataClient(FunctionImpor
? "\t\t\t\t\treturn validationResult;"
: $"\t\t\t\t\treturn (validationResult, default({realFunctionImportReturnType}));");
functionRegion.AppendLine();
functionRegion.AppendLine($"\t\t\t\tvar client = new ODataClient(\"{functionImportModel.EndpointUri}\");");
functionRegion.AppendLine($"\t\t\t\tvar client = new ODataClient(@\"{functionImportModel.EndpointUri}\");");
functionRegion.AppendLine(functionImportModel.FunctionReturnType == null
? "\t\t\t\tawait client"
: "\t\t\t\tvar result = await client");
Expand Down Expand Up @@ -266,7 +266,12 @@ private static string GetModelRegion(string modelClassName, List<IEdmFunctionPar
var current = 0;
foreach (var functionImportParameter in functionParameters)
{
var functionImportParameterType = functionImportParameter.Type.ToCodeStringType();
string functionImportParameterType;
if (isBindable && current == 0 && functionImportParameter.Type.IsCollection())
functionImportParameterType = functionImportParameter.Type.AsCollection().ElementType().ToCodeStringType();
else
functionImportParameterType = functionImportParameter.Type.ToCodeStringType();

regionModel.Append($"\t\t\tpublic {functionImportParameterType} {functionImportParameter.Name}");
regionModel.AppendLine(" { get; set; }");
if (++current != functionParameters.Count)
Expand Down

0 comments on commit bfef4c4

Please sign in to comment.