1
我想查看在LINQ查詢中生成的SQL。查看在ASP.NET Core中使用LINQ時生成的SQL
Question GetLatestPoll =
_contextService
.Find<Question>(q => q.Status == PollStatus.Open || (q.Status == PollStatus.Review)
&& ((q.Availability == PollAvailability.All)
|| (q.Availability == PollAvailability.Company && q.User.ClientId == currentUser.ClientId)
|| (q.Availability == PollAvailability.Company && q.User.DepartmentId == currentUser.DepartmentId))
&& !q.Answers.Any(a=>a.UserId == currentUser.Id))
.Include(q => q.Options)
.OrderByDescending(q => q.CreatedAt)
.FirstOrDefault();
我想使用類似var sql =Context.GetCommand(GetLatestPoll).CommandText;
但名稱上下文中不存在的核心。
`