title: Automapper: Update Only Few Column of Table
body: <p>I am using Automapper with Telerik Open Access ORM.
  Now my problem is there are 5 columns in my table <code>tblUser</code> like <code>Firstname</code>, <code>Lastname</code>, <code>Username</code>, <code>Email</code> and <code>Password</code>.
  Now when admin creates new user, it's password generated by some logic. </p>
  
  <p>The problem is in update. Currently I show password field on user detail page with readonly textbox. Now I don't want to show password field. So is there anyway I skip password field while update?</p>
  
  <p>I tried following but it throw error that password field as null.</p>
  
  <pre><code>var map = AutoMapper.Mapper.CreateMap&lt;UserDTO, TblUser&gt;().ForSourceMember(x=&gt;x.Password,y=&gt;y.Ignore());
  this.Update(entity);
  this.Save();
  return entity;
  
  public void Update(T entity)
  {
    dbContext.AttachCopy&lt;U&gt;(AutoMapper.Mapper.Map&lt;U&gt;(entity));
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Cannot insert the value NULL into column 'Password', table
    'MyDatabase.dbo.tblUsers'; column does not allow nulls. UPDATE
    fails.\r\nThe statement has been terminated.</p>
  </blockquote>
  
  <p>I don't know how to update by skipping some fields.</p>
  
  <p>For suppose I have 10 columns in insertion form and 5 columns in updation form for particular table, So while update I am taking other 5 column as hidden field to avoid error. But now I don't want to take other 5 fields as hidden. Isn't there any alternative exist?</p>