<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LINQ on InternetException</title><link>https://internetexception.com/tags/linq/</link><description>Recent content in LINQ on InternetException</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 31 Oct 2025 09:49:42 +0100</lastBuildDate><atom:link href="https://internetexception.com/tags/linq/index.xml" rel="self" type="application/rss+xml"/><item><title>Enhancing your .NET API with query language</title><link>https://internetexception.com/2025/10/30/enhancing-your-net-api-with-query-language/</link><pubDate>Thu, 30 Oct 2025 21:14:03 +0100</pubDate><guid>https://internetexception.com/2025/10/30/enhancing-your-net-api-with-query-language/</guid><description>&lt;p&gt;What is query language? SQL is Structured Query Language and you use it to query your database for data you are interested in. It does not have to do anything with your API. If you ever were working with big XML files you probably used XQuery or XPath, query languages designed to XML for data. There are specialized languages that are designed to work with APIs to query &lt;strong&gt;them&lt;/strong&gt; for data. For example, you probably heard about GraphQL or even used it when you were working with some API.&lt;/p&gt;</description></item><item><title>HLinq design</title><link>https://internetexception.com/2025/10/28/hlinq-design/</link><pubDate>Tue, 28 Oct 2025 21:14:55 +0100</pubDate><guid>https://internetexception.com/2025/10/28/hlinq-design/</guid><description>&lt;h2 id="a-bit-of-history"&gt;A bit of history&lt;/h2&gt;&#10;&lt;p&gt;I remember the day when I started writing the HLinq query language. It was weekend and I was experimenting with writing Single endpoints for &lt;a href="https://internetexception.com/2013/02/07/why-i-dont-like-python-anymore/" data-type="post" data-id="228"&gt;Hamster Wheel.&lt;/a&gt; Single endpoints were almost done and next step was to write List endpoint. This would allow to get list of records of specific type. After I got single GET returns correct data for chosen record id, list should not be hard to implement. Then just create, update and delete. Basic CRUD API in Hamster Wheel would be finished. I was thrilled that I actually was able to do such thing.&lt;/p&gt;</description></item><item><title>Linq</title><link>https://internetexception.com/2022/10/24/linq/</link><pubDate>Mon, 24 Oct 2022 15:05:47 +0200</pubDate><guid>https://internetexception.com/2022/10/24/linq/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;consistent model for working with data from various kinds of sources and formats (XML, SQL, ADO.NET, Datasets, .NET collections etc)&lt;/li&gt;&#10;&lt;li&gt;3 stages of working with LINQ:&#10;&lt;ul&gt;&#10;&lt;li&gt;obtain data source&lt;/li&gt;&#10;&lt;li&gt;create the query&lt;/li&gt;&#10;&lt;li&gt;execute the query&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;data sources implements &lt;code&gt;IEnumerable&amp;lt;&amp;gt;&lt;/code&gt; and are called &lt;code&gt;queryable types&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;IQueryable&amp;lt;&amp;gt;&lt;/code&gt; interface inherits from &lt;code&gt;IEnumerable&amp;lt;&amp;gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;generally it is better to use LINQ via &lt;code&gt;IQueryable&amp;lt;&amp;gt;&lt;/code&gt; which produces &lt;code&gt;deferred query&lt;/code&gt; instead of producing result immediately&lt;/li&gt;&#10;&lt;li&gt;queries can be executed multiple times&lt;/li&gt;&#10;&lt;li&gt;queries can be forced immediate execution via &lt;code&gt;Count()&lt;/code&gt;, &lt;code&gt;Max()&lt;/code&gt;, &lt;code&gt;ToList()&lt;/code&gt; or &lt;code&gt;ToArray()&lt;/code&gt; etc.&lt;/li&gt;&#10;&lt;li&gt;LINQ to DB libraries (like EntityFramework) usually are implemented via &lt;code&gt;Expression Trees&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>