System.InvalidCastException when try to save DateTime value

Topics: Troubleshooting
Sep 3, 2013 at 8:32 AM
Edited Sep 3, 2013 at 8:35 AM
Please ignore.. sorry
Sep 3, 2013 at 9:30 AM
The DB schema is still the same (with string column) if you didn't upgrade the module in migration using an UpdateFromX method. I'm not sure if this works (from string to DateTime) but you might add something like this to the migration class:

public int UpdateFrom1()
{
       SchemaBuilder
        .AlterTable("ArticlePartRecord", table => { 
             table.AlterColumn("PubDate",  x => x.WithType(DbType.DateTime))
          });
return 2;
}