<p>In SQL Server you can use the <code>IsNull()</code> function to check if a value is null, and if it is, return another value. Now I am wondering if there is anything similar in C#.</p>

<p>For example, I want to do something like:</p>

<pre><code>myNewValue = IsNull(myValue, new MyValue());
</code></pre>

<p>instead of:</p>

<pre><code>if (myValue == null)
  myValue = new MyValue();
myNewValue = myValue;
</code></pre>

<p>Thanks.</p>

It's called the null coalescing (
```
??
```
) operator:
```
```
myNewValue = myValue ?? new MyValue();
```
```