I would like to use the DateTime property in my model, supported by the MSSQL2008 type, which can contain at least 3 milliseconds. And I want to do this model-first , i.e. To be able to click "Generate Database from Model ..." in the VS2010 designer and get the correct result without additional configuration (I know that there are many workarounds).
My own research: I saw some other topics on the topic of datetime2 problems, but the problem is that the problem seems to be the opposite, getting datetime2 when they want datetime2. The solutions are written, which assumes that ProviderManifestToken = "2005" in EDMX gives the date and time, and ProviderManifestToken = "2008" gives the behavior of datetime2.
I want datetime2, and I already have ProviderManifestToken = "2008", but still get only datetime. There is an MSDN stream that offers a manually modified T4 template . But does T4 (or an EDMX file in a text editor) configure the only ways to execute datetime2 behavior in the First model? This is not a good way to add datetime precision properties to your EF model ...
Update: I sent this question to Microsoft Connect, you can find it here . Vote for him if you want to give him an impulse ...
source share