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();
}
}
You should check this out: https://blogs.msdn.microsoft.com/eliofek/2012/12/12/why-do-we-get-the-function-evaluation-requires-all-threads-to-run/
i couldn't comment so here we go as answer
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.