title: How do you convert a List query result to view model?
body: <p>I have an MVC controller method <code>List&lt;DataRow&gt; GetUserCriteria()</code> which runs a standard SQL Query, no EF or automapper. After running the query it does:</p>
  
  <pre><code>DataTable dt = new DataTable();
  SqlDataAdapter sdp = new SqlDataAdapter(objCommand)
  conn.Open();
  sdp.Fill(dt)
  list = dt.AsEnumerable().ToList();
  
  return list; 
  </code></pre>
  
  <p>Question is in my ActionResultMethod which returns the relevant view, how can I convert that list to the right type for the view model to consume and use in the view?</p>
  
  <pre><code>public ActionResult ClientProfile() {
  
    var rawData = GetUserCriteria();
    //Convert to type for view model here and pass into the view below. 
  
   return View()
  }
  </code></pre>