Entity Framework Timeouts

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Entity Framework Timeouts

Message par ForumBot »

Entity Framework Timeouts
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Entity Framework Timeouts

Message par ForumBot »

There is a known bug with specifying default command timeout within the EF connection string.

[http://bugs.mysql.com/bug.php?id=56806](http://bugs.mysql.com/bug.php?id=56806)

Remove the value from the connection string and set it on the data context object itself. This will work if you remove the conflicting value from the connection string.

Entity Framework Core:

```
this.context.Database.SetCommandTimeout(180);

```

Entity Framework 6:

```
this.context.Database.CommandTimeout = 180;

```

Entity Framework 5:

```
((IObjectContextAdapter)this.context).ObjectContext.CommandTimeout = 180;

```

Entity Framework 4 and below:

```
this.context.CommandTimeout = 180;

```
Répondre

Revenir à « .NET & C# »