I am using RTM for Visual Studio 2010 with RTM.NET/Entity Framework 4 RTM with a suitable model design. When I create an object with a DateTimeOffset field, the EF model tries to match the DateTimeOffset with SQL dates, not with SQL datetimeoffset. I am using SQL Server 2008 Express, so datetimeoffset is supported in the database.
In Visual Studio, this error occurs:
Error 2019: Membership Indication is invalid. The type "Edm.DateTimeOffset [Nullable = False, DefaultValue =, Precision =]" of the member "Created" in the type "Data.SqlStorage.MyType" is incompatible with the "SqlServer.datetime [Nullable = False, DefaultValue =, Precision = 3] 'member 'Created' in type 'Data.SqlStorage.Store.MyTypes
If I edit the type directly in the xml section of EDMX StorageModels, I get the following error:
Error 40: The datetimeoffset type does not match the namespace or aliases. Only primitive types can be used without qualification.
Why doesn't the fashion designer simply map this to the datetimeoffset SQL type? This issue also occurred when I was still working with beta versions of Visual Studio 2010 and the .NET framework 4.
source share