2

Im working on a .Net Web Api 2.2 project and I'm using Odata v4 and Entity Framework code first. I need to have a calculated property in a Model which is not to be saved in Database.

I have tried [notmapped] attribute. But it hides the property in Odata $medadata.

How can I overcome this issue?

Rahul
  • 2,431
  • 3
  • 35
  • 77

1 Answers1

2

You can manually add this property into model.

You can refer to the sample codes in: How to get Web API OData v4 to use DateTime

Hope it can help.

Community
  • 1
  • 1
Sam Xu
  • 3,264
  • 1
  • 12
  • 17