2016-07-12 77 views
1

我有一個ASP.NetMVC 5應用程序,我想,當我運行我的代碼來運行Entityframe work功能評估需要所有的線程運行

原始查詢我得到波紋管錯誤:

The function evaluation requires all threads to run

我的代碼:

  using (var context = new MyDbContext()) 
     { 
      //var blogs = context.MySupportContext.SqlQuery("SELECT * FROM dbo.Supports").ToList(); 
      string myQuery = "Select id, FullName, sum(mins) as Mins from (Select t.id, FullName, NumberOfSupports* st.Minutes as mins from(Select st.Id, st.FullName, count(s.Id) as NumberOfSupports, s.SupportTypeId from SupportTeams stINNER JOIN Supports s on s.ResponsibleId = st.Idgroup by st.id, st.FullName, s.SupportTypeId) t inner join SupportTypes st on st.id = t.SupportTypeId) t group by id, FullName "; 


      var blogs = context.Database.SqlQuery<string>(myQuery); 


      string qString= string.Empty; 

      if (blogs != null) 
      { 
       qString= blogs.ToString(); 
      } 
     } 

回答