help designing a method, should I use out or ref or return the type?
<p>I have a method that I will use in the following contexts:</p>

<p>1.</p>

<p>User user = null;</p>

<pre><code>if(...)
{
      user = defaultUser;
      SetUser(a,b,user);
}
else
{
      SetUser(a,b,user);
}

SaveUser(user);
</code></pre>

<p>So some cases are where user may be null, while in other cases it will already be initialized.</p>

<p>How should I design the SetUser method?</p>

<p><strong>I currently have it like so, but this causes an error when user is null.</strong></p>

<pre><code>public void SetUser(object a, object b, User user)
{
     if(user == null)
         user = new User();

     user.Security = a.security;
     user.Blah = b.type;
}
</code></pre>
