0

奇妙な問題:

メール通知テーブルに対して簡単なクエリを実行しようとしています:

        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))

何を確認する必要があるかについてのヒントはありますか?

4

1 に答える 1

0

申し訳ありません。接続文字列の問題であることが判明しました。

于 2013-02-18T11:09:13.280 に答える