Entity Framework Migrations: SqlException timeout during migration

Sql server available. I want to migrate a database using Entity Framework migration. There I have an β€œImages” table with 130x records that have images. When migrating, "INDEX" is added to the table using "CREATE INDEX". I get a SqlException that the command timed out. But in the connection string, I can only determine the connection timeout. I tried to determine the command timeout here: (IObjectContextAdapter)DbContext.ObjectContext.CommandTimeout , but that did not help me. And in DbMigrator too, but it has no such property anywhere.

So, I need help, I have to define a CommandTimeout for migration to the Entity Framework, but I don’t know how to do it. Help me plz sorry for bad english

+6
source share
1 answer

I do not think this is possible in EF4. It was added as a feature to the EF5 release candidate that was released this week: http://blogs.msdn.com/b/adonet/archive/2012/05/15/ef5-release-candidate-available-on- nuget.aspx

+4
source

Source: https://habr.com/ru/post/916186/


All Articles