Skip to content

odata-cli generated entity with "Context" property will not compile #297

@benbward

Description

@benbward

Describe the bug

When the entity includes a property named, "Context", a conflict arises with the Microsoft.OData.Client.BaseEntityType.Context object of the same name.

Version of the Project affected

Microsoft.OData.Cli v0.1.0
VisualStudio Version v17.2.3
Microsoft.Odata.Client v7.11.0

To Reproduce

Steps to reproduce the behavior:

  1. Define an OData api with an entity having a "Context" property. (<Property Name="Context" Type="Edm.String">)
  2. Use the OData CLI to generate classes.
  3. Build the project.
  4. Observe errors including 'string' does not contain a definition for 'EntityTracker'
  5. Observe a warning 'EssWorkflowWorkItem.Context' hides inherited member 'BaseEntityType.Context'.

Expected behavior

No compilation errors should occur.

Actual behavior

Compilation errors occur.

Screenshots

Additional context

We are working around this by removing the generated (and unused) method where the error occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions