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

Support Update...Where #9

Open
4 tasks
worldspawn opened this issue Feb 10, 2016 · 1 comment
Open
4 tasks

Support Update...Where #9

worldspawn opened this issue Feb 10, 2016 · 1 comment

Comments

@worldspawn
Copy link
Owner

  • Linq Expression Parser
  • T-Sql Language Processor
  • Postgres Language Processor
  • Query Api
@worldspawn
Copy link
Owner Author

Add support for deleting of entities that match a set of criteria. You do not to hydrate anything to use this.

In otherwords:

UPDATE [Entity]
Set Foo = 'Bar'
WHERE ...

as well as

UPDATE [Entity]
Set Foo = 'Bar'
FROM [TEntity]
JOIN ...
WHERE ...

I think this can run on top of the query system. The simple example might be:

session.Update<Order>((o) => o.DateCreated < DateTime.UtcNow, (o) => o.Foo = "Bar", (o) => o.Bar = "Foo");

or

session.Update<Order>((o) => o.DateCreated < DateTime.UtcNow, (o) => new Order { Foo = "Bar", Bar = "Foo" });

With joins

session.Update<Order>((ot) => ot.Join<OrderItem>((o, oi) => oi.OrderId == o.Id).Where(o => o.DateCreated < DateTime.UtcNow), (o) => new Order { Foo = "Bar", Bar = "Foo" });

In relying on an object constructor the entity would need a parameter-less constructor... or would it? I guess any constructor would be ok. Its parameters would be ignored?

@worldspawn worldspawn changed the title Support Delete...Where Support Update...Where Feb 10, 2016
@worldspawn worldspawn added this to the 0.0.1-alpha-1 milestone Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant