title: How to convert entity object to model class object
body: <p>I am new to entity framework. I want to know whether there is a way to convert entity type to the model class</p>
  
  <pre><code>public UserModel GetUserDetailsById(int userId)
  {
      using (var db = new klpm04222014Entities())
      {
           return db.klpm_user.Single(x =&gt; x.UserID == userId);
      }
  }
  </code></pre>
  
  <p>but it is giving error stating that</p>
  
  <pre><code>Cannot implicitly convert type 'klpm_user' to 'UserModel'   
  </code></pre>