{"action":"created","issue":{"url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/212","labels_url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/212/comments","events_url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/212/events","html_url":"https://github.com/mfenniak/rethinkdb-net/pull/212","id":69094673,"number":212,"title":"UpdateAndReturnChanges and DeleteAndReturnChanges overloads for sequences","user":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars.githubusercontent.com/u/126297?v=3","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-17T08:29:50Z","updated_at":"2015-04-17T13:21:46Z","closed_at":"2015-04-17T13:20:11Z","pull_request":{"url":"https://api.github.com/repos/mfenniak/rethinkdb-net/pulls/212","html_url":"https://github.com/mfenniak/rethinkdb-net/pull/212","diff_url":"https://github.com/mfenniak/rethinkdb-net/pull/212.diff","patch_url":"https://github.com/mfenniak/rethinkdb-net/pull/212.patch"},"body":"These two methods only took an `IMutableSingleObjectQuery<T>`, unlike their `Update()`/`Delete()` cousins.\r\n\r\nI've added overloads that accept an `ISequenceQuery<T>`. I didn't implement this for `Replace` because most the time it doesn't make sense, unless maybe you use `.Limit(1)`, but then just use `.Nth(0)` and make sure the object exists first.\r\n\r\nThis obviously allows you to update/delete rows and get the objects back without querying the database again:\r\n```\r\nvar u = conn.Run(Author.Table\r\n    .Filter(r => r.TVShow == \"House of Cards\")\r\n    .UpdateAndReturnChanges(r => new Author { Name = \"Something Here\" }));\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/comments/93984718","html_url":"https://github.com/mfenniak/rethinkdb-net/pull/212#issuecomment-93984718","issue_url":"https://api.github.com/repos/mfenniak/rethinkdb-net/issues/212","id":93984718,"user":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars.githubusercontent.com/u/126297?v=3","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T13:21:46Z","updated_at":"2015-04-17T13:21:46Z","body":"One thing I noticed is that `response.Changes` will be null instead of an empty array if the update/delete didn't match any rows. I assume this happens because the array is just deserialized and the `\"changes\"` element doesn't show up if there are no changes.\r\n\r\nhttps://github.com/mfenniak/rethinkdb-net/blob/master/rethinkdb-net/DmlResponse.cs#L55\r\n\r\nShouldn't be a problem to handle in my application code, but API-wise it is a little strange getting a `DmlResponse<T>` that `Changes` can sometimes be null. Thoughts?"}}