Can't cast to unsupported type 'DateTimeOffset' DataServiceContext

72 Views Asked by At

I'm trying to update a remote table using DataServiceContext like it shown here

on other tables, this method worked fine for me but now I'm getting this error:

Can't cast to unsupported type 'DateTimeOffset'

This is my code:

decimal hungerPercent = selectedWeight / (selectedDailyPercent * selectedPortionHeads * _batchWeight); //some calculation

var DeliveryGroup = _container.DeliveryGroups
                           .Where(x => x.GroupCode == selectedGroupCode && x.Branch == branch).First();

DeliveryGroup.HungerPercent = hungerPercent;                       

_container.UpdateObject(DeliveryGroup);
_container.SaveChanges();

and the table structure looks like this enter image description here

0

There are 0 best solutions below