I have a C# code that I want to execute.
str = "SELECT u.LastName " +
",COALESCE(COUNT(DISTINCT pc.PhraseId), 0) AS CreatedByQty " +
", COALESCE(COUNT(DISTINCT pm.PhraseId), 0) AS ModifiedByQty " +
"FROM dbo.AspNetUsers u " +
"LEFT JOIN dbo.Phrase pc " +
"ON u.Id = pc.CreatedBy " +
"LEFT JOIN dbo.Phrase pm " +
"ON u.Id = pm.ModifiedBy " +
"GROUP BY u.LastName ";
threeColQuery = db.Database.SqlQuery<threeCol>(str);
threeColReport = await threeColQuery.ToListAsync();
return Ok(threeColReport);
I know from running the query in SQL Server manager that it takes about 30 seconds.
When running in a Web API Call I get this:
"innerException":{"message":"An error has occurred.","exceptionMessage":"The wait operation timed
Is there a way I can allow a WebAPI call to run a long running query?