We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The text was updated successfully, but these errors were encountered:
Add support for deleting of entities that match a set of criteria. You do not to hydrate anything to use this.
In otherwords:
DELETE [Entity] WHERE ...
as well as
DELETE [Entity] FROM [TEntity] JOIN ... WHERE ...
I think this can run on top of the query system. The simple example might be:
session.Delete<Order>((o) => o.DateCreated < DateTime.UtcNow);
and more complex scenario: Delete orders that have order items and date created is less than now
session.Delete<Order>((ot) => ot.Join<OrderItem>((oi) => oi.OrderId == qt.Ex.Id).Where(o => o.DateCreated < DateTime.UtcNow))
ot is of type QueryTable<Order>
ot
QueryTable<Order>
It'd be nice to add Join overload that includes both the source and target table entity refs which would look like:
session.Delete<Order>((ot) => ot.Join<OrderItem>((o, oi) => oi.OrderId == o.Id).Where(o => o.DateCreated < DateTime.UtcNow))
Of course you can join on anything and thats what the other overload is for.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: