<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Check for Null/Not Null with is null and is { }	</title>
	<atom:link href="https://intellitect.com/blog/check-for-null-not-null/feed/" rel="self" type="application/rss+xml" />
	<link>https://intellitect.com/blog/check-for-null-not-null/</link>
	<description>Complex Software Development - Simplified</description>
	<lastBuildDate>Mon, 07 Aug 2023 21:26:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Erin		</title>
		<link>https://intellitect.com/blog/check-for-null-not-null/#comment-391232</link>

		<dc:creator><![CDATA[Erin]]></dc:creator>
		<pubDate>Mon, 07 Aug 2023 21:26:46 +0000</pubDate>
		<guid isPermaLink="false">https://intellitect.com/?p=36417#comment-391232</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://intellitect.com/blog/check-for-null-not-null/#comment-391129&quot;&gt;VonWeasel&lt;/a&gt;.

Thank you. Yes, using pattern matching to declare a variable with the empty property pattern is an effective way to combine the Is Not Null check with a variable definition that can then be used inside of the if-statement. 
Pattern matching is an area that has been receiving many enhancements in the C# language over the last few versions and each of the various patterns can be combined to produce very complicated checks (including for null). You can see more of them here: https://learn.microsoft.com/dotnet/csharp/fundamentals/functional/pattern-matching.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://intellitect.com/blog/check-for-null-not-null/#comment-391129">VonWeasel</a>.</p>
<p>Thank you. Yes, using pattern matching to declare a variable with the empty property pattern is an effective way to combine the Is Not Null check with a variable definition that can then be used inside of the if-statement.<br />
Pattern matching is an area that has been receiving many enhancements in the C# language over the last few versions and each of the various patterns can be combined to produce very complicated checks (including for null). You can see more of them here: <a href="https://learn.microsoft.com/dotnet/csharp/fundamentals/functional/pattern-matching" rel="nofollow ugc">https://learn.microsoft.com/dotnet/csharp/fundamentals/functional/pattern-matching</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: VonWeasel		</title>
		<link>https://intellitect.com/blog/check-for-null-not-null/#comment-391129</link>

		<dc:creator><![CDATA[VonWeasel]]></dc:creator>
		<pubDate>Fri, 28 Jul 2023 18:14:31 +0000</pubDate>
		<guid isPermaLink="false">https://intellitect.com/?p=36417#comment-391129</guid>

					<description><![CDATA[for the &quot;is { }&quot; method you can give a variable name afterward that works for static analysis. 
Like so: 

if(Foo() is {} foo){
    // do something with &quot;foo&quot; here
}]]></description>
			<content:encoded><![CDATA[<p>for the &#8220;is { }&#8221; method you can give a variable name afterward that works for static analysis.<br />
Like so: </p>
<p>if(Foo() is {} foo){<br />
    // do something with &#8220;foo&#8221; here<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marlon Eduardo Peña Llanos		</title>
		<link>https://intellitect.com/blog/check-for-null-not-null/#comment-382681</link>

		<dc:creator><![CDATA[Marlon Eduardo Peña Llanos]]></dc:creator>
		<pubDate>Tue, 13 Oct 2020 17:58:30 +0000</pubDate>
		<guid isPermaLink="false">https://intellitect.com/?p=36417#comment-382681</guid>

					<description><![CDATA[Thanks!!]]></description>
			<content:encoded><![CDATA[<p>Thanks!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: flori		</title>
		<link>https://intellitect.com/blog/check-for-null-not-null/#comment-378601</link>

		<dc:creator><![CDATA[flori]]></dc:creator>
		<pubDate>Thu, 14 Nov 2019 10:30:11 +0000</pubDate>
		<guid isPermaLink="false">https://intellitect.com/?p=36417#comment-378601</guid>

					<description><![CDATA[a) if ((object)variable == null)
b) ReferenceEquals(variable, null)
works in c# no matter which version
a) for most analysers: they don&#039;t understand that the type cast modifies the ==-operator]]></description>
			<content:encoded><![CDATA[<p>a) if ((object)variable == null)<br />
b) ReferenceEquals(variable, null)<br />
works in c# no matter which version<br />
a) for most analysers: they don&#8217;t understand that the type cast modifies the ==-operator</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
