奇妙な問題:
メール通知テーブルに対して簡単なクエリを実行しようとしています:
using (MyContext context = new MyContext())
{
IQueryable<EmailNotification> query = context.EmailNotifications.Where(q => (q.LastSendAttemptStatus == EmailNotificationSendStatuses.Pending) || (q.LastSendAttemptStatus == EmailNotificationSendStatuses.Resend));
return query.ToList();
}
行があっても結果は返されません。実際、それが生成する SQL を見て、何も変更せずに実行したところ、正しい結果が得られました。
SELECT
[Extent1].[EmailNotificationID] AS [EmailNotificationID],
[Extent1].[From] AS [From],
[Extent1].[To] AS [To],
[Extent1].[Cc] AS [Cc],
[Extent1].[Bcc] AS [Bcc],
[Extent1].[Subject] AS [Subject],
[Extent1].[Body] AS [Body],
[Extent1].[LastSendAttemptOn] AS [LastSendAttemptOn],
[Extent1].[LastSendAttemptStatus] AS [LastSendAttemptStatus],
[Extent1].[FailureComments] AS [FailureComments]
FROM [dbo].[EmailNotifications] AS [Extent1]
WHERE (0 = CAST( [Extent1].[LastSendAttemptStatus] AS int)) OR (3 = CAST( [Extent1]. [LastSendAttemptStatus] AS int))
何を確認する必要があるかについてのヒントはありますか?