<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Csharp on runaho.dev</title><link>https://19785411.runaho-dev.pages.dev/categories/csharp/</link><description>Recent content in Csharp on runaho.dev</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 23 Nov 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://19785411.runaho-dev.pages.dev/categories/csharp/index.xml" rel="self" type="application/rss+xml"/><item><title>Accessing the index of an element when using foreach in C#</title><link>https://19785411.runaho-dev.pages.dev/engineering/csharp-foreach-index/</link><pubDate>Tue, 23 Nov 2021 00:00:00 +0000</pubDate><guid>https://19785411.runaho-dev.pages.dev/engineering/csharp-foreach-index/</guid><description>&lt;p&gt;Hi, today I am here with an extremely simple article.&lt;/p&gt;
&lt;p&gt;While writing foreach, you may need to access the index sometimes, although using for blocks makes more sense in such cases, it is possible to access the index while using foreach.&lt;/p&gt;
&lt;p&gt;Normally I wouldn’t write about this topic, but it has been discussed a little on stackoverflow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For this, it is necessary to have a little understanding of the using of lists.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>C# 8.0 ??= Null Coalescing Operators &amp; Encapsulation</title><link>https://19785411.runaho-dev.pages.dev/engineering/csharp-null-coalescing/</link><pubDate>Sat, 20 Nov 2021 00:00:00 +0000</pubDate><guid>https://19785411.runaho-dev.pages.dev/engineering/csharp-null-coalescing/</guid><description>&lt;p&gt;Hi, in today’s article, I will share my experiences using the ??= operator that came with C# 8.0.&lt;/p&gt;
&lt;p&gt;Sometimes in C# we mean that if an object is empty then set to another object otherwise we want to continue using that object.&lt;/p&gt;
&lt;h2 id="now-lets-make-an-example" class="relative group"&gt;Now let’s make an example. &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#now-lets-make-an-example" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;This operator briefly functions as assign the right object if the left object is empty, otherwise return the left one.&lt;/p&gt;</description></item></channel></rss>