The scenario is that I have some properties that I don't want to map to EF. So I set NotMapped to them. However I want to show them on odata. So I explicitly add those properties:
var user = builder.EntitySet<User>("Users").EntityType;
user.Property(u => u.CorrectAnswerCount);
user.Property(u => u.TotalAnswerCount);
user.Property(u => u.Rank);
But the code doesn't work. Those columns are still not shown up on the payload.
Comments: Yes, it is a bug that our default convention should not override if someone has explicitly mapped the properties. As a workaround, you can do this in the OnModelBuilding event on the conventional model builder, then it should just work.
var user = builder.EntitySet<User>("Users").EntityType;
user.Property(u => u.CorrectAnswerCount);
user.Property(u => u.TotalAnswerCount);
user.Property(u => u.Rank);
But the code doesn't work. Those columns are still not shown up on the payload.
Comments: Yes, it is a bug that our default convention should not override if someone has explicitly mapped the properties. As a workaround, you can do this in the OnModelBuilding event on the conventional model builder, then it should just work.