title: Entity Framework - Update a row in a table
body: <p>I am new to Entity Framework and i have a question regarding updating data in a table.</p>
  
  <p>Currently, I am using the following approach to update data and looking for a better way if somebody can help me out.</p>
  
  <p>Let's say I am updating "Category" table and it has only 3 fields(id, name, archived)</p>
  
  <pre><code>private void UpdateCategory(category entity)
  {
      category  catObj = context.category.find(e=&gt; e.id == id);
      catObj.name = entity.name;
      catObj.archived = entity.archived;
      context.savechanges();
  }
  </code></pre>
  
  <p>My question is if there are 50 fields in category table I will have to assign each field individually. Can't i do something like this .. catObj = entity; ?</p>