I have the following code in my HomeController:
public ActionResult Edit(int id)
{
var ArticleToEdit = (from m in _db.ArticleSet where m.storyId == id se
It looks like you are using entity framework. My solution was to switch all datetime columns to datetime2, and use datetime2 for any new columns, in other words make EF use datetime2 by default. Add this to the OnModelCreating method on your context:
modelBuilder.Properties().Configure(c => c.HasColumnType("datetime2"));
That will get all the DateTime and DateTime? properties on all the entities in your model.