Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete including Top condition does not work #292

Open
Mortimer76 opened this issue Jan 20, 2014 · 0 comments
Open

Delete including Top condition does not work #292

Mortimer76 opened this issue Jan 20, 2014 · 0 comments

Comments

@Mortimer76
Copy link

The following linq statement

 (
     from messageEvent in s.Query<MessageEventDTO>()
      join msg in s.GetTable<MessageDTO>() on messageEvent.MessageName equals msg.Name
     where (messageEvent.TimestampConfirmed < olderThan &&
          (messageEvent.TimestampGone < olderThan || msg.MessageType != MessageType.OnlyOnceLeaving))
     select messageEvent
).Take(maxDeleteCountPerCommand).Delete(); 

is converted to the sql statement

DELETE [messageEvent]
FROM
    [Common_MessageSystem_Events] [messageEvent]
        INNER JOIN [Common_MessageSystem_Messages] [msg] ON [messageEvent].[MessageName] = [msg].[Name]
WHERE
    [messageEvent].[TimestampConfirmed] < @p1 AND ([messageEvent].[TimestampGone] < @p2 OR [msg].[MessageType] <> 20)

so the Top / Take condition is not considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant