OData / ODataConnectedService

A Visual Studio extension for generating client code for OData Services
Other
79 stars 41 forks source link

Unsigned Data Types Couldn't Be Found #386

Open NguyenTam opened 5 months ago

NguyenTam commented 5 months ago

Describe the bug

I followed an instruction to generate an automatic code, based on my OData server's metadata. Code generation was completed, but two kind of error occurred:

  1. invalid variable name, due to an extra space. (I fixed this manually by replacing space with underscore. This post is not about this bug)
  2. The type or namespace name of 'UInt16', 'UInt32', and 'UInt32' don't exist in the namespace 'A.B.C'. Their UnderlyingType are Edm.Int32, Edm.Int64, and Edm.Decimal, respectively (See below image).

odata_metadata_typedefinition

Below screenshot illustrate errors from my VS 2022. It is repetitive, but shows where the errors occurred: odata_generated_code_namespace_error

So I wonder, if OData's code generator can handle unsigned data type? Is there anything I can do to fix this?

Version of the Project affected

ODataConnectedService 2022+ version: 1.0.2 VisualStudio Enterprise 2022 Version v17.8.6 Microsoft.Odata.Client v7.20.0

To Reproduce

I just followed the Creating a sample client application using OData Connected Service, then all errors are in the default Reference.cs file.

Expected behavior

No error in namespace