{"id":99,"date":"2008-10-19T09:29:00","date_gmt":"2008-10-19T09:29:00","guid":{"rendered":"https:\/\/wdev-blog.azurewebsites.net\/index.php\/2008\/10\/19\/lambda-expression-and-linq-extension\/"},"modified":"2008-10-19T09:29:00","modified_gmt":"2008-10-19T09:29:00","slug":"lambda-expression-and-linq-extension","status":"publish","type":"post","link":"http:\/\/panahy.nl\/index.php\/2008\/10\/19\/lambda-expression-and-linq-extension\/","title":{"rendered":"Lambda Expression and LINQ Extension"},"content":{"rendered":"<p>As I learn more about LINK I hope these things become more of an automatic choice rather than keeping notes&#8230; but for now I am stil new to LINQ:<\/p>\n<p>You can use two different ways to retrieve items from a database. The first one is uses the DataContext to call the stored procedure and in a LINQ syntax:<\/p>\n<pre><br \/>NorthwindDataContext db = new NorthwindDataContext();<br \/>var results  = from item in db.CustOrderHist(\"category\")<br \/>       where item.Total > 10<br \/>       select item;<br \/><\/pre>\n<p>and the second way is to use the extension with a lumbda expression:<\/p>\n<pre><br \/>results = db.CustOrderHist(\"category\")<br \/>           .where (item => Item.Total > 10);<br \/><br \/><\/pre>\n<p>I still havn&#8217;t figure out which one has which benefits comparing the other way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I learn more about LINK I hope these things become more of an automatic choice rather than keeping notes&#8230; but for now I am stil new to LINQ: You can use two different ways to retrieve items from a database. The first one is uses the DataContext to call the stored procedure and in &hellip; <a href=\"http:\/\/panahy.nl\/index.php\/2008\/10\/19\/lambda-expression-and-linq-extension\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Lambda Expression and LINQ Extension&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[81,33],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"Pouya Panahy","author_link":"http:\/\/panahy.nl\/index.php\/author\/pouya\/"},"uagb_comment_info":0,"uagb_excerpt":"As I learn more about LINK I hope these things become more of an automatic choice rather than keeping notes&#8230; but for now I am stil new to LINQ: You can use two different ways to retrieve items from a database. The first one is uses the DataContext to call the stored procedure and in&hellip;","_links":{"self":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/99"}],"collection":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}