{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/668","repository_url":"https://api.github.com/repos/dotnet/csharplang","labels_url":"https://api.github.com/repos/dotnet/csharplang/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/csharplang/issues/668/comments","events_url":"https://api.github.com/repos/dotnet/csharplang/issues/668/events","html_url":"https://github.com/dotnet/csharplang/issues/668","id":234726822,"number":668,"title":"Anonymous type declaration","user":{"login":"Thaina","id":1042507,"avatar_url":"https://avatars2.githubusercontent.com/u/1042507?v=3","gravatar_id":"","url":"https://api.github.com/users/Thaina","html_url":"https://github.com/Thaina","followers_url":"https://api.github.com/users/Thaina/followers","following_url":"https://api.github.com/users/Thaina/following{/other_user}","gists_url":"https://api.github.com/users/Thaina/gists{/gist_id}","starred_url":"https://api.github.com/users/Thaina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thaina/subscriptions","organizations_url":"https://api.github.com/users/Thaina/orgs","repos_url":"https://api.github.com/users/Thaina/repos","events_url":"https://api.github.com/users/Thaina/events{/privacy}","received_events_url":"https://api.github.com/users/Thaina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-06-09T05:43:33Z","updated_at":"2017-06-11T04:58:03Z","closed_at":null,"body":"Most of the time I play with anonymous type is really satisfied. I could write a long chain of linq or async code without caring for modifying complex type\r\n\r\nUntil I need to refactor and make a function out of it then it lose the very precious anonymity\r\n\r\nI wish we could declare anonymous type outside function code. Such as\r\n\r\n```C#\r\nIEnumerable<{ string name,string surname }> PersonByID LoadPersonFromDB()\r\n{\r\n    return (await db.LoadAllRows()).Select((row) => new { name = row[\"name\"],surname = row[\"surname\"] });\r\n}\r\n```\r\n\r\nTuple seem cover this issue but the problem of tuple is it is valueType and the old library (such as dictionary) does not support return `ref struct`. We don't have a way to create reference type tuple\r\n\r\nSorry if this is duplicate. I could not find any issue like this by searching for **Anonymous type**\r\n\r\nps. Also I wish we should have a feature for mutable reference tuple. If we would create new syntax for this `Anonymous type declaration`. I think it should be mutable"},"comment":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/comments/307606658","html_url":"https://github.com/dotnet/csharplang/issues/668#issuecomment-307606658","issue_url":"https://api.github.com/repos/dotnet/csharplang/issues/668","id":307606658,"user":{"login":"MgSam","id":1965570,"avatar_url":"https://avatars3.githubusercontent.com/u/1965570?v=3","gravatar_id":"","url":"https://api.github.com/users/MgSam","html_url":"https://github.com/MgSam","followers_url":"https://api.github.com/users/MgSam/followers","following_url":"https://api.github.com/users/MgSam/following{/other_user}","gists_url":"https://api.github.com/users/MgSam/gists{/gist_id}","starred_url":"https://api.github.com/users/MgSam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MgSam/subscriptions","organizations_url":"https://api.github.com/users/MgSam/orgs","repos_url":"https://api.github.com/users/MgSam/repos","events_url":"https://api.github.com/users/MgSam/events{/privacy}","received_events_url":"https://api.github.com/users/MgSam/received_events","type":"User","site_admin":false},"created_at":"2017-06-11T04:58:03Z","updated_at":"2017-06-11T04:58:03Z","body":"If you have a type with 44 different float properties, it should definitely not be anonymous. "}}
{"actor":{"display_login":"MgSam"}}