AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

Issue when using camelcase enums

Open corranrogue9 opened this issue 3 years ago • 1 comments

Assemblies affected Hypothetical version with latest ModelBuilder, and latest version

Describe the bug When investigating if we needed changes to support the new camelcase enum feature from ModelBuilder, I discovered a couple of issues.

  1. When using the new feature, this test case fails when the correct casing is used for the enum. Is this how we want to support camel casing? That only camel casing is allowed?
  2. This test does not succeed either. It should find the single entity with the Third key. Note that neither casing (third or Third) works. I think that there is a bug when using an enum as a key. Once that bug is fixed, we should also investigate if the camel casing is supported when routing.

corranrogue9 avatar Jul 13 '22 23:07 corranrogue9

  1. From triage, we decided that both test cases should pass
  2. Sam suggested adding [FromODataUri] to the parameter in the controller method to get the deserialization to work correctly

corranrogue9 avatar Jul 20 '22 17:07 corranrogue9