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

Type Edm.PropertyPath is not supported #343

Open
HeikoTheissen opened this issue Apr 22, 2023 · 1 comment
Open

Type Edm.PropertyPath is not supported #343

HeikoTheissen opened this issue Apr 22, 2023 · 1 comment
Labels
Feature New feature

Comments

@HeikoTheissen
Copy link

HeikoTheissen commented Apr 22, 2023

Describe the bug

A complex type with a property of type Edm.PropertyPath leads to an error. But this type (and others, like Edm.NavigationPropertyPath) can occur in OData V4 services as type of an annotation term.

Version of the Project affected

ODataConnectedService 2022+ v1.0.1
Microsoft Visual Studio Professional 2022 (64-bit) v17.5.4
Microsoft.Odata.Client v7.15.0

To Reproduce

Import the following OData V4 metadata:

<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
   <Schema Namespace="self" xmlns="http://docs.oasis-open.org/odata/ns/edm">
     <EntityContainer Name="EntityContainer">
       <EntitySet Name="Dates" EntityType="self.Date" />
     </EntityContainer>
     <EntityType Name="Date">
       <Key>
         <PropertyRef Name="id" />
       </Key>
       <Property Name="id" Type="Edm.Guid" Nullable="false" />
     </EntityType>
     <Term Name="MainProperty" Type="self.MainPropertyType" AppliesTo="EntityType" />
     <ComplexType Name="MainPropertyType">
       <Property Name="Main" Type="Edm.PropertyPath" />
     </ComplexType>
   </Schema>
</edmx:DataServices>
</edmx:Edmx>

Expected behavior

Generation of a working C# OData client.

Actual behavior

An error occurs:

Adding OData Connected Service to the project failed: Could not get CLR type name for EDM type 'Edm.PropertyPath'

Screenshots

n/a

Additional context

n/a

@habbes habbes added the Feature New feature label Apr 25, 2023
@habbes
Copy link
Contributor

habbes commented Apr 25, 2023

Marking this as a feature request because the library doesn't currently have any suitable representation for Edm.PropertyPath as type property. It's not clear what code should be generated for this. We'll have to do some design work on this. Maybe we should create a custom type to represent Edm.PropertyPath in CLR objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants