{"action":"closed","issue":{"url":"https://api.github.com/repos/MarimerLLC/csla/issues/364","labels_url":"https://api.github.com/repos/MarimerLLC/csla/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/MarimerLLC/csla/issues/364/comments","events_url":"https://api.github.com/repos/MarimerLLC/csla/issues/364/events","html_url":"https://github.com/MarimerLLC/csla/issues/364","id":83797444,"number":364,"title":"Analyzer: Capture Result of Save() to Variable","user":{"login":"JasonBock","id":904213,"avatar_url":"https://avatars.githubusercontent.com/u/904213?v=3","gravatar_id":"","url":"https://api.github.com/users/JasonBock","html_url":"https://github.com/JasonBock","followers_url":"https://api.github.com/users/JasonBock/followers","following_url":"https://api.github.com/users/JasonBock/following{/other_user}","gists_url":"https://api.github.com/users/JasonBock/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonBock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonBock/subscriptions","organizations_url":"https://api.github.com/users/JasonBock/orgs","repos_url":"https://api.github.com/users/JasonBock/repos","events_url":"https://api.github.com/users/JasonBock/events{/privacy}","received_events_url":"https://api.github.com/users/JasonBock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MarimerLLC/csla/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"JasonBock","id":904213,"avatar_url":"https://avatars.githubusercontent.com/u/904213?v=3","gravatar_id":"","url":"https://api.github.com/users/JasonBock","html_url":"https://github.com/JasonBock","followers_url":"https://api.github.com/users/JasonBock/followers","following_url":"https://api.github.com/users/JasonBock/following{/other_user}","gists_url":"https://api.github.com/users/JasonBock/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonBock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonBock/subscriptions","organizations_url":"https://api.github.com/users/JasonBock/orgs","repos_url":"https://api.github.com/users/JasonBock/repos","events_url":"https://api.github.com/users/JasonBock/events{/privacy}","received_events_url":"https://api.github.com/users/JasonBock/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/MarimerLLC/csla/milestones/16","html_url":"https://github.com/MarimerLLC/csla/milestones/4.6.300","labels_url":"https://api.github.com/repos/MarimerLLC/csla/milestones/16/labels","id":1339544,"number":16,"title":"4.6.300","description":"","creator":{"login":"rockfordlhotka","id":2333134,"avatar_url":"https://avatars.githubusercontent.com/u/2333134?v=3","gravatar_id":"","url":"https://api.github.com/users/rockfordlhotka","html_url":"https://github.com/rockfordlhotka","followers_url":"https://api.github.com/users/rockfordlhotka/followers","following_url":"https://api.github.com/users/rockfordlhotka/following{/other_user}","gists_url":"https://api.github.com/users/rockfordlhotka/gists{/gist_id}","starred_url":"https://api.github.com/users/rockfordlhotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockfordlhotka/subscriptions","organizations_url":"https://api.github.com/users/rockfordlhotka/orgs","repos_url":"https://api.github.com/users/rockfordlhotka/repos","events_url":"https://api.github.com/users/rockfordlhotka/events{/privacy}","received_events_url":"https://api.github.com/users/rockfordlhotka/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":30,"state":"open","created_at":"2015-10-06T03:57:56Z","updated_at":"2015-12-07T19:11:56Z","due_on":"2015-12-31T06:00:00Z","closed_at":null},"comments":3,"created_at":"2015-06-02T02:31:19Z","updated_at":"2015-12-07T19:11:56Z","closed_at":"2015-12-07T19:11:56Z","body":"Most of the time, when Save() is called on a business object, the intent is to do this:\r\n\r\nobj = obj.Save();\r\n\r\nHowever, it's easy to forget to do this, and it can lead to weird, unexpected states in the BO.\r\n\r\nThis analyzer would flag this as a warning, potentially with a code fix to add the assignment.\r\n\r\n(Note: this may be a little more difficult if the result is set to a property or field, as that may be a valid intent by the developer, so need to ensure this case isn't flagged as an issue. I personally don't know of any time where I assigned the result of Save() this way, but it's possible.)"}}