Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support temporal types with EF #279

wants to merge 2 commits into from


Copy link

Now in RESTier, supported mapping options for temporal types are:

EF Type SQL Type Edm Type Need ColumnAttribute?
System.DateTime DateTime/DateTime2 Edm.DateTimeOffset Y
System.DateTimeOffset DateTimeOffset Edm.DateTimeOffset N
System.DateTime Date Edm.Date Y
System.TimeSpan Time Edm.TimeOfDay Y
System.TimeSpan Time Edm.Duration N


*Unless all the three types are DateTimeOffset, the time zone would always be assumed +00.00 to ensure the consistency of type conversion.

The basic CRUD and query options are tested with the temporal types. However due to a bug in OData Web API, currently built-in functions (e.g., hour, minute, etc.) on Edm.TimeOfDay cannot work well yet. And due to another bug in ODL, the type annotations of the temporal types in full metadata payload MAY be incorrect.

*Will provide documentation for this feature later.

Copy link
Contributor Author

The issue of built-in functions on Edm.TimeOfDay in OData Web API has been fixed by OData/WebApi#614. Thanks @xuzhg !

Copy link
Contributor Author

Close first. Will send another one later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants