For Database first Aproach:
We can still set it in a constructor, by override the ContextName.Context.tt T4 Template this way:
<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
{
public <#=code.Escape(container)#>()
: base("name=<#=container.Name#>")
{
Database.CommandTimeout = 180;
<#
if (!loader.IsLazyLoadingEnabled(container))
{
#>
this.Configuration.LazyLoadingEnabled = false;
<#
}
Database.CommandTimeout = 180;
is the acutaly change.
The generated output is this:
public ContextName() : base("name=ContextName")
{
Database.CommandTimeout = 180;
}
If you change your Database Model, this template stays, but the actualy class will be updated.