Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: NotMapped property can't be add explicitly by model builder [824]

$
0
0
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.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>