<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NuGet on InternetException</title><link>https://internetexception.com/tags/nuget/</link><description>Recent content in NuGet 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/nuget/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>Writing a simple C# source code generator with Fluent API</title><link>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</link><pubDate>Thu, 02 Oct 2025 16:05:39 +0200</pubDate><guid>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;&#10;&lt;p&gt;Usually in .NET world when you want to write generic code you use generic method or classes. But sometimes it is still not enough when you want to automate some things. I.e. you want to dynamically register in &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-9.0" target="_blank" rel="noopener noreferrer"&gt;DI&lt;/a&gt;&#10; all the classes that implements some interface. Probably, in this case, you would do something like that:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;Assembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Types&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetInterfaces&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddScoped&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And it would be completely fine. Even if Reflection is pretty slow, your application would not be getting significantly slower because of that. Certainly you would not notice the slow down.&lt;/p&gt;</description></item><item><title>HamsterWheel.FluentCodeGenerators is out</title><link>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</link><pubDate>Wed, 01 Oct 2025 16:58:21 +0200</pubDate><guid>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</guid><description>&lt;p&gt;I released today first new Nuget package connected to my new project that I am working on for sometime: dynamically configurable, zero-downtime API, with low-code flows to write small pieces of logic - &lt;a href="https://internetexception.com/why-hamster-wheel/" data-type="page" data-id="666"&gt;Hamster Wheel&lt;/a&gt;.&lt;br&gt;&#10;&lt;br&gt;&#10;System heavily relies on dynamic source code generation. For that I wrote&lt;br&gt;&#10;&lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators&lt;/a&gt;&#10; and &lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions&lt;/a&gt;&#10;&lt;br&gt;&#10;small package that helps with writing C# incremental source code generators for Roslyn compiler.&lt;br&gt;&#10;&lt;br&gt;&#10;Original Roslyn APIs are a bit hard to use so this package helps with that. Also it helps with:&lt;br&gt;&#10;\&lt;/p&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 3.</title><link>https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/</link><pubDate>Fri, 02 Sep 2016 13:15:00 +0200</pubDate><guid>https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/</guid><description>&lt;p&gt;&lt;strong&gt;This is third article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous articles and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read first two. If you are just looking for a way to create delegates for methods or constructors it is not necessary.&lt;/strong&gt; Code with new features and with bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package.&lt;/p&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 2.</title><link>https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/</link><pubDate>Tue, 16 Aug 2016 12:59:00 +0200</pubDate><guid>https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/</guid><description>&lt;p&gt;&lt;strong&gt;This is second article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous article and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read it first. If you are just looking for a way to create delegates for methods or constructors it is not necessary.&lt;/strong&gt; Last article in series you can find &lt;a href="https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/" title="Third part"&gt;here&lt;/a&gt;&#10;. Code with new features and with bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package. In previous &lt;a href="https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/"&gt;article&lt;/a&gt;&#10; and first one in series, we covered:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Static&#10;&lt;ol&gt;&#10;&lt;li&gt;Properties&lt;/li&gt;&#10;&lt;li&gt;Fields&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Instance&#10;&lt;ol&gt;&#10;&lt;li&gt;Properties&lt;/li&gt;&#10;&lt;li&gt;Fields&lt;/li&gt;&#10;&lt;li&gt;Indexers&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Now it is time to cover following members.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Static&#10;&lt;ol&gt;&#10;&lt;li&gt;Methods&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Instance&#10;&lt;ol&gt;&#10;&lt;li&gt;Methods&lt;/li&gt;&#10;&lt;li&gt;Constructors&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 1.</title><link>https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/</link><pubDate>Fri, 05 Aug 2016 09:58:00 +0200</pubDate><guid>https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/</guid><description>&lt;p&gt;This article is first part of the series of three. Next ones you can find &lt;a href="https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/" title="Second part"&gt;here&lt;/a&gt;&#10; and &lt;a href="https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/" title="Third part"&gt;here&lt;/a&gt;&#10;. Code for all three articles, with new features and bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package.&lt;/p&gt;&#10;&lt;h3 id="why-not-reflection"&gt;Why not Reflection?&lt;/h3&gt;&#10;&lt;p&gt;If you working with .NET and C# (probably other languages too), at some point, you will have to write more advanced and generic code, that i.e. reads all properties of a type, searches for attributes, etc. Or maybe you want to call some private method or property? It is not that rare to use some internal mechanism of framework or library. Usually, the first solution involves Reflection. But the thing is: Reflection is slow. Of course, it is sufficient if you need to use Reflection rarely and it is not the main code of the application. If it is used more often at some point, you will probably try to optimize it. And now is the fun part: how to do it?&lt;/p&gt;</description></item><item><title>WebSocket libraries comparison</title><link>https://internetexception.com/2014/02/21/websocket-libraries-comparison/</link><pubDate>Fri, 21 Feb 2014 14:38:00 +0100</pubDate><guid>https://internetexception.com/2014/02/21/websocket-libraries-comparison/</guid><description>&lt;p&gt;Web project often requires to push data to clients as fast as possible, whenever it is necessary without waiting for client request. It is perfect for website with real time communication between users, like with online communicators for example. Or document collaboration tools. Or maybe system status updates on long running calculation/tasks performed by server. In every case two way communication mechanism is ideal.&lt;/p&gt;</description></item><item><title>Entity Framework Patterns extension and Unit Test in Visual Studio 2012</title><link>https://internetexception.com/2013/04/23/entity-framework-patterns-extension-and-unit-test-in-visual-studio-2012/</link><pubDate>Tue, 23 Apr 2013 02:18:00 +0200</pubDate><guid>https://internetexception.com/2013/04/23/entity-framework-patterns-extension-and-unit-test-in-visual-studio-2012/</guid><description>&lt;p&gt;Yesterday I was trying to make work simple test class in VS2012. I did not know what was wrong exactly. It was first project when I tried to glue together Entity Framework with repository pattern and Ninject as IoC container. Because of the fact that this was first time for solution like that I was sure that it is me, or rather source of my problem was indeed my code. But let&amp;rsquo;s not skip ahead.&lt;/p&gt;</description></item></channel></rss>