I have an MVC controller method List<DataRow> GetUserCriteria()
which runs a standard SQL Query, no EF or automapper. After running the query it does:
DataTable dt = new DataTable();
SqlDataAdapter sdp = new SqlDataAdapter(objCommand)
conn.Open();
sdp.Fill(dt)
list = dt.AsEnumerable().ToList();
return list;
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?
public ActionResult ClientProfile() {
var rawData = GetUserCriteria();
//Convert to type for view model here and pass into the view below.
return View()
}