Entity framework support for MySql unsigned decima

2019-09-18 14:13发布

问题:

Entity framework just ignores unsigned decimal column when doing db-first to generate code, since I can't change the data type of the db column to signed, any solution?

回答1:

Do you need to "enforce" non-negative values? Use a TRIGGER.

Or, if the values are whole numbers, then use some suitably sized INT UNSIGNED in place of DECIMAL.