phenomenon: When using EF to add records, the above exception has been reported, the net value is empty, the primary key outside the key is not set, etc., but the problem is still correct in these cases
resolution process: There is a sentence in the exception (see internal exception), has not been the case, and then there is no way to calm down to see, the content of the exception is as follows:
InnerException:System.Data.SqlClient.SqlException
hresult=-2146232060
Message=implicit conversion from the data type nvarchar to varbinary are not allowed. Use the CONVERT function to run this query.
The message table name cannot be converted from nvarchar to varbinary, and is then carefully reviewed in the database field set to varbinary (carelessness), and is intended to be set to varchar
To resolve a problem by changing the database field type to varchar
An error occurred while EF updated the entry. For more information, see inner exception.