功能评估需要运行所有线程

时间:2016-07-12 11:10:12

标签: c# asp.net asp.net-mvc entity-framework asp.net-mvc-5

我有ASP.Net MVC 5个应用,我想用Entityframe work

运行原始查询

当我运行我的代码时,我得到了以下错误:

  

功能评估需要运行所有线程

我的代码:

         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();
            }
        }

1 个答案:

答案 0 :(得分:0)