A similar issue has been posted in the past about scaffolding in .net core 2 but that was on a date column and no solution has been posted to date.
There's no specific table as any table containing a datetime column type throws the following error from the console:
Could not find type mapping for column 'database.table.columnname' with data type 'datetime'. Skipping column.
This answer to a question about reading datetime values and a MySQL quirk with 0000-00-00 00:00:00 values made me wonder if changing the connection string format would help. So I added the ConvertZeroDateTime=true to the connection string in the scaffold command:
Scaffold-DbContext "server=localhost;port=3306;user=root;password=notherealpassword;database=sodb;ConvertZeroDateTime=true;" MySql.Data.EntityFrameworkCore -OutputDir Model -f
I still have the same error, does anyone have any suggestions? I have 380+ tables in this database so an automated solution would be most helpful.




