views:

22

answers:

0

I try to create a WCF Data Service for an Entity Framework model, which contains some attributes of type DateTimeOffeset. However the WCF Data Service does not support the type DateTimeOffset as I found out after googling the exception text "The property 'CreationTime' on type 'Task' is of type 'DateTimeOffset' which is not a supported primitive type.'. See server logs for more details. The exception stack trace is: ...".

I'm now considering different approaches to solve this problem including:

  1. change the type to something that can be mapped to DateTime in the database (worst solution)

  2. Leave the column type in the database as DateTimeOffset, Map the column to two attributes in the Entity Framework model, one DateTime and an additional "Offset" attribute of type integer.

I really don't like any of these approaches. Has anyone found a good work around to fix this issue?

Thanks!