我有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();
}
}
答案 0 :(得分:0)