Previously, I updated the model by going to the EntityModel page in Visual Studio, but the update didn't take effect. Later, I found out that if you assign a default value to a column in SQL Server, the corresponding column in your model must have its StoreGeneratedPattern
property set to Computed
. Otherwise, even if a default value exists in the database, you'll still get errors like "Cannot insert null" when sending null
from your code, because the default value won't be triggered.