If you're using the DI container to manage the DbContext (i.e. you're adding the DbContext to the service collection), the command timeout can be specified in the options.
In Startup.cs file ConfigureServices method.
services.AddDbContext<YourDbContext>(options => options.UseSqlServer(
this.Configuration.GetConnectionString("YourConnectionString"),
sqlServerOptions => sqlServerOptions.CommandTimeout(60))
);
Same code are as below
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<KLASSAKTContext>(option => option.UseSqlServer(Configuration.GetConnectionString("DbKlassakt"),
sqlServerOptions => sqlServerOptions.CommandTimeout(60)));
}
Hope it is help you,
Arjun Walmiki
No comments:
Post a Comment