Skip to content

Add support for emitting System.DateOnly and System.TimeOnly when Microsoft.OData.Client >= 9.0.0#442

Open
WanjohiSammy wants to merge 14 commits intoOData:masterfrom
WanjohiSammy:fix/add-support-for-dotnet-nativedatetimetypes
Open

Add support for emitting System.DateOnly and System.TimeOnly when Microsoft.OData.Client >= 9.0.0#442
WanjohiSammy wants to merge 14 commits intoOData:masterfrom
WanjohiSammy:fix/add-support-for-dotnet-nativedatetimetypes

Conversation

@WanjohiSammy
Copy link
Member

@WanjohiSammy WanjohiSammy commented Jan 7, 2026

Fixes #439

Description

This PR adds support for generating native .NET date/time types (System.DateOnly and System.TimeOnly) in the OData Connected Service VS extension and Microsoft.OData.Cli tool when the project references Microsoft.OData.Client version 9.0.0 or greater.

Background

Starting with Microsoft.OData.Client version 9.0.0, the OData client library supports native .NET date and time types (DateOnly and TimeOnly) instead of the legacy Microsoft.OData.Edm.Date and Microsoft.OData.Edm.TimeOfDay types. This change enables better interoperability with modern .NET applications and aligns with the .NET ecosystem's shift toward native temporal types.

This Change

Introduce an EmitNativeDateTimeTypes property that is computed based on the Microsoft.OData.Client version referenced in the project:

  • When Microsoft.OData.Client >= 9.0.0: Generate System.DateOnly and System.TimeOnly
  • When Microsoft.OData.Client < 9.0.0: Generate Microsoft.OData.Edm.Date and Microsoft.OData.Edm.TimeOfDay (backward compatible)

@WanjohiSammy WanjohiSammy force-pushed the fix/add-support-for-dotnet-nativedatetimetypes branch from c8dde22 to 32881e3 Compare January 7, 2026 20:18
@WanjohiSammy WanjohiSammy force-pushed the fix/add-support-for-dotnet-nativedatetimetypes branch from b75ccf2 to a4b1baf Compare January 8, 2026 19:08
@WanjohiSammy WanjohiSammy changed the title Add support for dotnet Native DateTime types Add support for emitting System.DateOnly and System.TimeOnly when Microsoft.OData.Client >= 9.0.0 Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Microsoft.OData.Edm.Date is obsolete

1 participant