{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/1746","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/1746/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/1746/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/1746/events","html_url":"https://github.com/dotnet/roslyn/issues/1746","id":65799381,"number":1746,"title":"Proposal: XML literals and embedded expressions in C#","user":{"login":"weitzhandler","id":2716316,"avatar_url":"https://avatars.githubusercontent.com/u/2716316?v=3","gravatar_id":"","url":"https://api.github.com/users/weitzhandler","html_url":"https://github.com/weitzhandler","followers_url":"https://api.github.com/users/weitzhandler/followers","following_url":"https://api.github.com/users/weitzhandler/following{/other_user}","gists_url":"https://api.github.com/users/weitzhandler/gists{/gist_id}","starred_url":"https://api.github.com/users/weitzhandler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitzhandler/subscriptions","organizations_url":"https://api.github.com/users/weitzhandler/orgs","repos_url":"https://api.github.com/users/weitzhandler/repos","events_url":"https://api.github.com/users/weitzhandler/events{/privacy}","received_events_url":"https://api.github.com/users/weitzhandler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Language-C%23","name":"Language-C#","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"MadsTorgersen","id":6677272,"avatar_url":"https://avatars.githubusercontent.com/u/6677272?v=3","gravatar_id":"","url":"https://api.github.com/users/MadsTorgersen","html_url":"https://github.com/MadsTorgersen","followers_url":"https://api.github.com/users/MadsTorgersen/followers","following_url":"https://api.github.com/users/MadsTorgersen/following{/other_user}","gists_url":"https://api.github.com/users/MadsTorgersen/gists{/gist_id}","starred_url":"https://api.github.com/users/MadsTorgersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadsTorgersen/subscriptions","organizations_url":"https://api.github.com/users/MadsTorgersen/orgs","repos_url":"https://api.github.com/users/MadsTorgersen/repos","events_url":"https://api.github.com/users/MadsTorgersen/events{/privacy}","received_events_url":"https://api.github.com/users/MadsTorgersen/received_events","type":"User","site_admin":false},"milestone":null,"comments":30,"created_at":"2015-04-01T23:24:53Z","updated_at":"2016-04-08T20:09:27Z","closed_at":"2015-07-12T02:48:54Z","body":"Hi,\r\n\r\nI am a born VB dev. Currently I develop only C# because I prefer the terse syntax over VB's verbose words, but I do miss some awesome features we had in VB.\r\nOne of the most notable and very compelling features I do miss very much, is the awesome [XML literals](https://msdn.microsoft.com/en-us/library/bb384629.aspx) and [Embedded Expressions](https://msdn.microsoft.com/en-us/library/bb384964.aspx) paradise going on in VB.  \r\nAs soon as you get used to these features, separating out really feels like going hardcoded back again.\r\nWhen I'm to develop a project that involves a lot of XML I'll prefer VB, eventho I don't like it's verbose syntax, and won't be able to link to other source files of my C# code base.\r\n\r\nAnyway for those of you unfamiliar with VB, get a taste. Notice how all the XML literals are recognized as XML by the compiler (they're not wrapped with double-quotes).\r\n\r\n    'infered as XElement\r\n    Dim contact1 =\r\n        <contact>\r\n          <name>Patrick Hines</name>\r\n          <phone type=\"home\">206-555-0144</phone>\r\n          <phone type=\"work\">425-555-0145</phone>\r\n        </contact>\r\n    \r\n     'infered as XDocument\r\n    Dim contactDoc =\r\n        <?xml version=\"1.0\"?>\r\n        <contact>\r\n          <name>Patrick Hines</name>\r\n          <phone type=\"home\">206-555-0144</phone>\r\n          <phone type=\"work\">425-555-0145</phone>\r\n        </contact>\r\n    \r\nManipulating objects with strings (embedded expressions):\r\n\r\n    Public Class XmlSamples\r\n    \r\n      Public Sub Main()\r\n        ' Initialize the objects.  \r\n    \r\n        Dim phoneNumbers2 As Phone() = { \r\n            New Phone(\"home\", \"206-555-0144\"), \r\n            New Phone(\"work\", \"425-555-0145\")}\r\n    \r\n        ' Convert the data contained in phoneNumbers2 to XML.  \r\n    \r\n        Dim contact2 = \r\n            <contact>\r\n              <name>Patrick Hines</name>\r\n              <%= From p In phoneNumbers2 \r\n                Select <phone type=<%= p.Type %>><%= p.Number %></phone> \r\n              %>\r\n            </contact>\r\n    \r\n        Console.WriteLine(contact2)\r\n      End Sub \r\n    \r\n    End Class \r\n    \r\n    Class Phone\r\n      Public Type As String \r\n      Public Number As String \r\n      Public Sub New(ByVal t As String, ByVal n As String)\r\n        Type = t\r\n        Number = n\r\n      End Sub \r\n    End Class"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/207582332","html_url":"https://github.com/dotnet/roslyn/issues/1746#issuecomment-207582332","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/1746","id":207582332,"user":{"login":"HaloFour","id":10102290,"avatar_url":"https://avatars.githubusercontent.com/u/10102290?v=3","gravatar_id":"","url":"https://api.github.com/users/HaloFour","html_url":"https://github.com/HaloFour","followers_url":"https://api.github.com/users/HaloFour/followers","following_url":"https://api.github.com/users/HaloFour/following{/other_user}","gists_url":"https://api.github.com/users/HaloFour/gists{/gist_id}","starred_url":"https://api.github.com/users/HaloFour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaloFour/subscriptions","organizations_url":"https://api.github.com/users/HaloFour/orgs","repos_url":"https://api.github.com/users/HaloFour/repos","events_url":"https://api.github.com/users/HaloFour/events{/privacy}","received_events_url":"https://api.github.com/users/HaloFour/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T20:09:27Z","updated_at":"2016-04-08T20:09:27Z","body":"LINQ query syntax is only SQL-like, it's not SQL and it doesn't tie C# to any outside language/format specifications.\r\n\r\nI think that when integrating logic with wire formats like XML, HTML or JSON that a templating engine like razor makes more sense."}}