{"id":1851,"date":"2013-01-25T17:20:46","date_gmt":"2013-01-25T08:20:46","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=1851"},"modified":"2018-08-14T18:35:22","modified_gmt":"2018-08-14T09:35:22","slug":"c-linq-query","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=1851","title":{"rendered":"[C#] LINQ query"},"content":{"rendered":"<p><b>Program that uses foreach with LINQ query [C#]<\/b><\/p>\n<pre class=\"lang:vim decode:true \" >using System;\r\nusing System.Linq;\r\n \r\nclass Program\r\n{\r\n    static void Main()\r\n    {\r\n\t\/\/ An unsorted string array.\r\n\tstring[] letters = { \"d\", \"c\", \"a\", \"b\" }; \/\/ Use LINQ query syntax to sort the array alphabetically. \r\n        var sorted = from letter in letters orderby letter \r\n        select letter; \/\/ Loop with the foreach keyword. \r\n        foreach(string value in sorted) \r\n         { \r\n             Console.WriteLine(value); \r\n          } \r\n    } \r\n} \r\nOutput\r\na \r\nb \r\nc \r\nd<\/pre>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Program that uses foreach with LINQ query [C#] using System; using System.Linq; class Program { static void Main() { \/\/ An unsorted string array. string[] <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=1851\" title=\"[C#] LINQ query\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1851","post","type-post","status-publish","format-standard","hentry","category-devc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1851"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}