mfenniak / rethinkdb-net

A C# / .NET client driver for RethinkDB.
Other
247 stars 37 forks source link

Allow MemberInit inside of a conditional expression #230

Closed nkreipke closed 8 years ago

nkreipke commented 8 years ago

It's me again,

this is the last one for now. This one makes it possible to use MemberInit expressions inside of conditional expressions, allowing you to do things like:

query.Update(t => (t.SomeCondition ? new Person { ... } : t))

This is quite handy if you want to update a document only if a condition evaluates to true, I guess it can be handy in other cases as well.

Sorry for the sudden burst of pull requests, I made these changes for a project which is now going to prod and I wanted to make sure everything works before I submit them to you. Thanks for the driver by the way!

Kind regards, Nico