C# - Assigning the result of a boolean expression
<p>I'm not sure if this is a feature that c# supports, but it is a construct that I use in javascript programming and I am hoping to use the construct with c# if it supports it (.net Framework 3.5).</p>

<p>I have the following working code:</p>

<pre><code>if (user.Status == AccountStatus.Active) {
  status = true;
} else {
  status = false;
}
</code></pre>

<p>I would like to shorten it as follows:</p>

<pre><code>status = (user.Status == AccountStatus.Active);
</code></pre>

<p>In Javascript this will assign the true / false result of the evaluation within the parenthesis. This appears not to work for me in c#, and results in a generic compilation error.</p>

<p>Is there an alternative way to achieve this in a way that is compact?</p>
