I am working on an Entity Framework project using SQL Server 2008. Recently, we have changed the use of the field type datetime2for many of our dates as we need precision.
This works great with our real-time databases and development, but as part of our end-to-end tests, we use SQL Server CE 4.0, which does not support type datetime2. The moment the Entity Framework tries to build the database, it returns a series of exceptions like this:
error 0040: The Type datetime2 is not qualified with a namespace or alias. Only primitive types can be used without qualification.
Obviously, there is no value in changing our production code for testing purposes, so is there a way to tell him to convert the values datetime2to normal datetimeor convert them to varchar?
The purpose of the test is to ensure that everything from the data layer to the interface works as expected, so if there is a better way to implement such a test, it can be a useful alternative.
source
share