RGR
RGR

Reputation: 1571

'Date' datatype of a column is not updating in EF

Initially, for Date_IN column in my DB i set it as 'DateTime' datatype. Then due to some issues, i modified it to 'Date' datatype. But when i tried to update the model in Entity Framework by right clicking in the designer 'Update model from Database', the column datatype is not setting to 'Date' datatype.

Modified datatype for Date_IN column:

enter image description here

Update Model from database: enter image description here

Datetype not changed:

enter image description here

In the properties for the column, i even could not find 'Date' datatype. Please check through the below images for further details. Please let me know how to proceed with this. Any alternatives?

Upvotes: 1

Views: 703

Answers (1)

Jane S
Jane S

Reputation: 1487

There is no Date type in C# (which is what it's showing you in the Type field). So even if you change your data type in the database from datetime to date it will still map to a DateTime in your model in EF.

Upvotes: 1

Related Questions