title: AutoMapper - Why it is overwriting whole object?
body: <p>I don't understand why it's overwriting my whole object. The reason is that I get my <code>User</code> object from db an I want to assign new values from DTO. Instead of just adding those new values it's creating new object that has new values but all previous are set to <code>null</code>.</p>
  
  <p>How can I make sure that in this case he will "upgrade" my object, not create new one?</p>
  
  <h1>Scenario</h1>
  
  <p><code>/users/{id}</code> - PUT</p>
  
  <pre><code>// User has id, username, fullname
  // UserPut has fullname
  public HttpResponseMessage Put(int id, UserPut userPut)
  {
      var user = _db.Users.SingleOrDefault(x =&gt; x.Id == id); // filled with properties
  
      Mapper.CreateMap&lt;UserPut, User&gt;();
      user = Mapper.Map&lt;User&gt;(userPut); // now it has only "fullname", everything else set to null
  
      // I can't save it to db because everything is set to null except "fullname"
  
      return Request.CreateResponse(HttpStatusCode.OK, user);
  }
  </code></pre>