 <p>Since there are only 5 constant columns, I would go with the simple solution:</p> <pre><code>var data = ctx.tblEmp.SingleOrDefault(e =&gt; e.Id == model.Id); switch (columnName) { case "Id": data.id = newValue; //newValue should have a correct type. break; case "name": data.name = newValue; break; case "desig": data.desig = newValue; break; case "depart": data.depart = newValue; break; case "Sal": data.Sal = newValue; break; } </code></pre>