How can I set the command timeout of a DbContext?
Please try the following code before you execute any DB command. The following Code need 3/4 minute to execute. So, CommandTimeout set 300 (in seconds) before execution of the command.
public List ReadCollectionEfficiencyByUnitOfficeSummary(string yearMonth, string locationCode, string reportType)
{
((System.Data.Entity.Infrastructure.IObjectContextAdapter)context).ObjectContext.CommandTimeout = 300;
return context.CollectionEfficiencyByUnitOfficeSummary(yearMonth, locationCode, reportType).ToList();
}