1
を実行するために、すべてのスレッドが必要です:機能評価は、私は私は私のコードを実行したとき、私は怒鳴るエラーを取得する<code>Entityframe work</code></p> <p>との生のクエリを実行したい、<code>ASP.Net</code><code>MVC 5</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();
}
}
私はこれを試しましたが、私のためには機能しません。また、説明はありませんか? – Lopsided