{"id":58,"date":"2013-09-11T17:10:00","date_gmt":"2013-09-11T22:10:00","guid":{"rendered":"https:\/\/www.chrystalsander.com\/blog\/?p=58"},"modified":"2023-07-26T15:59:16","modified_gmt":"2023-07-26T20:59:16","slug":"linq-an-introduction","status":"publish","type":"post","link":"https:\/\/www.chrystalsander.com\/blog\/?p=58","title":{"rendered":"LINQ : An Introduction"},"content":{"rendered":"<div style=\"margin-bottom: 0in;\">\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/bb397926.aspx\" target=\"_blank\" rel=\"noopener\">LINQ<\/a> is an acronym for \u201cLanguage<br \/>\nIntegrated Query.\u201d  It\u2019s been around since Visual Studio 2008 but<br \/>\nin the works far in advance of that; however, many companies are just<br \/>\nnow using it for the first time.   It is a programming model<br \/>\ndeveloped by Microsoft to allow developers to query several types of<br \/>\nobjects as if they were querying a SQL database.  For example,<br \/>\ndevelopers can now query for a textbox on a form with the ease of<br \/>\nquerying for a row in a database table \u2013 often, with less overhead.<\/p>\n<\/div>\n<div style=\"margin-bottom: 0in;\">\n<\/div>\n<div style=\"margin-bottom: 0in;\">\nThe syntax is similar to SQL except<br \/>\nthat the clauses are ordered differently.  For example, note the<br \/>\nfollowing LINQ query:<\/div>\n<div style=\"margin-bottom: 0in;\">\n<\/div>\n<div style=\"background: #ffffff; line-height: 100%; margin-bottom: 0in;\">\n<span style=\"font-family: Courier New, serif;\"><span style=\"font-size: x-small;\"><span style=\"color: blue;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">var<\/span><\/span><\/span><span style=\"color: black;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">&nbsp;queryProduct&nbsp;=<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"background: #ffffff; line-height: 100%; margin-bottom: 0in;\">\n<span style=\"font-family: Courier New, serif;\"><span style=\"font-size: x-small;\"><span style=\"color: blue;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">from<\/span><\/span><\/span><span style=\"color: black;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">&nbsp;p&nbsp;<\/span><\/span><\/span><span style=\"color: blue;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">in<\/span><\/span><\/span><span style=\"color: black;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">&nbsp;products<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"background: #ffffff; line-height: 100%; margin-bottom: 0in;\">\n<span style=\"font-family: Courier New, serif;\"><span style=\"font-size: x-small;\"><span style=\"color: blue;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">select<\/span><\/span><\/span><span style=\"color: black;\"><span style=\"font-family: Consolas, serif;\"><span style=\"font-size: 9pt;\">&nbsp;p.ProductName;<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"background: #ffffff; line-height: 100%; margin-bottom: 0in;\">\n<\/div>\n<p><\/p>\n<div style=\"margin-bottom: 0in;\">\nCommon objects queryable by LINQ are<br \/>\nenumerable classes, arrays,  datasets, and XML documents.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>LINQ is an acronym for \u201cLanguage Integrated Query.\u201d It\u2019s been around since Visual Studio 2008 but in the works far in advance of that; however, many companies are just now using it for the first time. It is a programming model developed by Microsoft to allow developers to query several types of objects as if &hellip; <a href=\"https:\/\/www.chrystalsander.com\/blog\/?p=58\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;LINQ : An Introduction&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[83],"_links":{"self":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58"}],"collection":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":1,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}