Assign and check for a null value at the same time?
<p>I have the following scenario:</p>

<pre><code>if(xml.Descendants(ns + "Children").FirstOrDefault() != null)
{
    XElement children = xml.Descendants(ns + "Children").FirstOrDefault();
}
</code></pre>

<p>Is there a way I can check for null and assign the value at the same time instead of having to search for the value twice, something similar to:</p>

<pre><code>//Not sure if this is correct.
if (XElement children = xml.Descendants(ns + "Children").FirstOrDefault() != null)
{

}
</code></pre>
