title: Entity Framework 4 maps DateTimeOffset to SQL datetime in Visual Studio 2010
body: <p>I'm using Visual Studio 2010 RTM with .NET/Entity Framework 4 RTM with a model driven design approach.
  When I create an entity with a DateTimeOffset field the EF modeler tries to map the DateTimeOffset to a SQL datetime instead of a SQL datetimeoffset.
  I'm using SQL Server 2008 Express so the datetimeoffset is supported in the database.</p>
  
  <p>Visual Studio comes up with this error:</p>
  
  <blockquote>
    <p>Error 2019: Member Mapping specified is not valid. The type 'Edm.DateTimeOffset[Nullable=False,DefaultValue=,Precision=]' of member 'Created' in type 'Data.SqlStorage.MyType' is not compatible with 'SqlServer.datetime[Nullable=False,DefaultValue=,Precision=3]' of member 'Created' in type 'Data.SqlStorage.Store.MyTypes</p>
  </blockquote>
  
  <p>If I edit the type directly in the EDMX StorageModels xml section I get the following error:</p>
  
  <blockquote>
    <p>Error 40: The Type datetimeoffset is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.   </p>
  </blockquote>
  
  <p>Why doesn't the modeler just correctly map this to a SQL datetimeoffset type? 
  This problem also occured when I was still working with the beta versions of Visual Studio 2010 &amp; .NET framework 4.</p>