{"action":"created","issue":{"url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/164","repository_url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials","labels_url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/164/comments","events_url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/164/events","html_url":"https://github.com/icsharpcode/RefactoringEssentials/issues/164","id":126883811,"number":164,"title":"Analyzer for wrong usage of async methods","user":{"login":"Rpinski","id":1767539,"avatar_url":"https://avatars.githubusercontent.com/u/1767539?v=3","gravatar_id":"","url":"https://api.github.com/users/Rpinski","html_url":"https://github.com/Rpinski","followers_url":"https://api.github.com/users/Rpinski/followers","following_url":"https://api.github.com/users/Rpinski/following{/other_user}","gists_url":"https://api.github.com/users/Rpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/Rpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rpinski/subscriptions","organizations_url":"https://api.github.com/users/Rpinski/orgs","repos_url":"https://api.github.com/users/Rpinski/repos","events_url":"https://api.github.com/users/Rpinski/events{/privacy}","received_events_url":"https://api.github.com/users/Rpinski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/labels/feature%20request","name":"feature request","color":"0052cc"},{"url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/labels/Language-C%23","name":"Language-C#","color":"bfe5bf"},{"url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/labels/up-for-grabs","name":"up-for-grabs","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-01-15T14:32:57Z","updated_at":"2016-08-12T07:49:29Z","closed_at":null,"body":"Example async method:\r\n\r\n```\r\n        public Task<string> DoSomethingAsync(string str)\r\n        {\r\n            return Task.FromResult(str);\r\n        }\r\n```\r\n\r\nExamples of wrong usage:\r\n\r\n```\r\n        public async Task Scenario1Async()\r\n        {\r\n            var usedCorrectly = await DoSomethingAsync(\"helloworld\");\r\n\r\n            // obviously wrong, but could happen for fire-and-forget cases where you don't check eg the boolean result\r\n            var blatantlywrong = DoSomethingAsync(\"get it going\");\r\n        }\r\n\r\n        public async Task Scenario2Async()\r\n        {\r\n            var usedCorrectly = await DoSomethingAsync(\"helloworld\");\r\n\r\n            // If you have models that happen to have an Id property (very likely when working with dbs)\r\n            var stillwrong = DoSomethingAsync(\"guess what\");\r\n            var x = stillwrong.Id;\r\n        }\r\n\r\n        public void Scenario3()\r\n        {\r\n            // Creatively wrong\r\n            List<string> somestrings = new List<string>() { \"Hello\", \"World\" };\r\n            var result = somestrings.Select(DoSomethingAsync).ToList();\r\n            Console.WriteLine(result[1]);\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/comments/239383011","html_url":"https://github.com/icsharpcode/RefactoringEssentials/issues/164#issuecomment-239383011","issue_url":"https://api.github.com/repos/icsharpcode/RefactoringEssentials/issues/164","id":239383011,"user":{"login":"bexxx","id":10616556,"avatar_url":"https://avatars.githubusercontent.com/u/10616556?v=3","gravatar_id":"","url":"https://api.github.com/users/bexxx","html_url":"https://github.com/bexxx","followers_url":"https://api.github.com/users/bexxx/followers","following_url":"https://api.github.com/users/bexxx/following{/other_user}","gists_url":"https://api.github.com/users/bexxx/gists{/gist_id}","starred_url":"https://api.github.com/users/bexxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bexxx/subscriptions","organizations_url":"https://api.github.com/users/bexxx/orgs","repos_url":"https://api.github.com/users/bexxx/repos","events_url":"https://api.github.com/users/bexxx/events{/privacy}","received_events_url":"https://api.github.com/users/bexxx/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T07:49:29Z","updated_at":"2016-08-12T07:49:29Z","body":"There is already the project asyncusage.analyzers. Maybe that is a better place to add this to."}}
{"actor":{"display_login":"bexxx"}}