0

I made an OData service that exposes some data from and Access Database, everything is working fine i am successfully reading the data.

On this link i found that OData supports "Edm.Date" which is a date only object type. https://msdn.microsoft.com/en-us/library/ff478141.aspx

If i use DateTime or DateTimeOffset it includes time in the output and in the schematic (metadata) i see that it isn't of "Edm.Date" type.

After some google-in around i didn't find anything that would suggest that C# has "date only" object type.

I am using the default Visual Studio 2013 OData project template.

My question is, what object type do i need to use in C# so that it converts to "Edm.Date" in the OData service ?

2
  • Just use DateTime. The result should have a "zero" time.
    – D Stanley
    Feb 18, 2015 at 14:32
  • There's also an Edm.DateTimeOffset field which contains both date and time. Maybe you should just use that and not have to worry about the "date only" issue.
    – Zoomzoom
    Feb 19, 2015 at 14:56

1 Answer 1

0

If you are using ASP.NET Web API for OData V4 to write your service, the Edm.Date and Edm.TimeOfDay support will come in the next release (i.e. v5.5) in March.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.