It's been a long time since we've created the model using code first. It's been a bit of a review today, but there are problems.
Now wrap it up.
After I have done the initial operations, when I update the database with Update-database-verbose, there is always a System.InvalidOperationException: an issue with an instance failure
is very annoyed, the Internet to find a lot of solutions always not. But I think it's a problem with my connection string.
The connection string is as follows
<add name="prodbcontext" connectionstring="Data source=desktop-hfnne8j \\c_supreme;initial catalog=procomment; Persist Security info=true; User Id=sa; password=******; "providername="System.Data.SqlClient"/>
Here the data Source has two \ This, because I used to use SQL statements to connect to the database is two \ One word will be escaped the problem of failure.
However, today's instance failure is the reason for this escape character. I removed a \ Transfer symbol and executed it successfully.
Description migrations can automatically recognize escape characters
Resolves an issue where System.InvalidOperationException: instance failed using migrations execution update-database