Code first custom SQL migration timeout exception

后端 未结 2 1361
栀梦
栀梦 2020-12-10 01:33

I am trying to create FULL TEXT index using Entity Framework Migration by executing custom Sql.

My migration class looks like this:

public partial cl         


        
相关标签:
2条回答
  • 2020-12-10 02:10

    Your request processing may be taking more time than default command timeout of entity framework(30 sec). You can increase command timeout if necessary as in thread below.

    Entity Framework Timeouts

    0 讨论(0)
  • 2020-12-10 02:21

    Use Configuration.cs file to set custom time out:

    internal sealed class Configuration : DbMigrationsConfiguration<ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            ContextKey = "YourDbContext";
    
            // New timeout in seconds
            this.CommandTimeout = 60 * 5; 
        }
    }
    
    0 讨论(0)
提交回复
热议问题