简体   繁体   中英

The function evaluation requires all threads to run

I have an ASP.Net MVC 5 application, I want to run a raw query with Entityframe work

when I run my code I get bellow error:

The function evaluation requires all threads to run

my code:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM