{"id":532,"date":"2016-10-25T07:56:58","date_gmt":"2016-10-25T06:56:58","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=532"},"modified":"2017-11-03T15:33:52","modified_gmt":"2017-11-03T14:33:52","slug":"c-linq-examples","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/c-linq-examples\/","title":{"rendered":"C# Linq Examples"},"content":{"rendered":"<p>Join:<\/p>\n<pre lang=\"c#\">var data = db.Product\r\n                            .Join(db.ArtikelGroep,\r\n                                a =&gt; a.ProductId,\r\n                                b =&gt; b.HoofdGroepId,\r\n                                (a, b) =&gt; new { a, b })\r\n                            .Where(p =&gt; p.a.ProductId &lt; 25).OrderBy(p =&gt; p.a.Name);\r\n                    var records = data.ToList();\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>GroupBy:<\/p>\n<pre lang=\"c#\">var results = persons.GroupBy( p =&gt; new { p.Id, p.Name }, \r\n                               p =&gt; p.car,\r\n                               (key, g) =&gt; new { \r\n                                      PersonId = key, \r\n                                      Cars = g.ToList() \r\n                                  }\r\n                              );\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Join: var data = db.Product .Join(db.ArtikelGroep, a =&gt; a.ProductId, b =&gt; b.HoofdGroepId, (a, b) =&gt; new { a, b }) .Where(p =&gt; p.a.ProductId &lt; 25).OrderBy(p =&gt; p.a.Name); var records = data.ToList(); &nbsp; GroupBy: var results = persons.GroupBy( p =&gt; new { p.Id, p.Name }, p =&gt; p.car, (key, g) =&gt; new { PersonId = key, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":2,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":920,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/532\/revisions\/920"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}