kubal5003
kubal5003

Reputation: 7254

Entity Framework 4 - using DateTime2

I want Entity Framework to store all my dates as DateTime2 data type.

I have ProviderManifestToken="2008" in my SSDL and still all the generated dates are DateTime instead of DateTime2. What am I missing?

Upvotes: 1

Views: 832

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364279

You are not missing anything. Entity framework never uses DataTime2 unless you manually modify its database generation process (only in model first approach). You need to update SSDLToSQL10.tt file to use DateTime2 instead of DateTime. Check the end of this answer for more details about modifying the template and configuring VS to use the new template.

Upvotes: 1

Related Questions