I want to enable camel casing of my odata results. So I added EnableLowerCamelCase
. But after I enabled that I get the following error message when I call:
http://localhost/odata/Users
The EDM instance of type '[Core.DomainModel.User Nullable=True]' is missing the property 'id'.
Everything worked before I EnableLowerCamelCase
, and it works again if I remove it. Also the error message is rather confusing. It says that User is missing the 'id' property. Which cannot be true. Because I have 'Id' defined as the key.
var builder = new ODataConventionModelBuilder();
builder.EnableLowerCamelCase();
var users = builder.EntitySet<User>(nameof(UsersController).Replace("Controller", string.Empty));
users.EntityType.HasKey(x => x.Id); // <--- id property
builder.GetEdmModel();
What am I doing wrong?