Hi All,
I am using a WCF Data service with Entity framework. This WCF service is directly linked with a DB entity and endpoints for this service are auto-generated based on the tables present within the DB. I have configured the service to be compatible with V3 version of OData protocol by adding the following line in the service.
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
When I try to POST a data object having date field, I am passing the datetime in ISO format string from client to the server. eg. for date - "10-Aug-2021 10:21 AM IST" I will pass it as "2021-08-10T04:51:00.000Z" in ISO.
dataObject = {
"Created": "2021-08-10T04:51:00.000Z"
}
When I use V2, i.e. by passing the header "MaxDataServiceVersion" with value 2.0, data is being stored in proper format, i.e. it adds +5.30 to the date time and stored it as 2021-08-10T10:21:00.000 in the DB
But, when I request the same body by passing "3.0" for "MaxDataServiceVersion" header, date is being stored as "2021-08-10T04:51:00.000" in the table which is not proper.
Request you all please provide help if you can on this issue.
Thanks,
Shreyash