Shailesh Bist

Shailesh Bist

  • 2.2k
  • 10
  • 228

DateTime binding in MVC Core

Dec 9 2022 4:59 AM


This is my first try at MVC Core. 

I have a table with datetime data type. I have defined the model for this table.

When I declare the property in the model as datetime, the model does not show any records.

When I declare the property as string, the model shows data, but then then the context returns invalid cast from datetime to string error.

Kindly guide.


Answers (6)