title: Select top 1 from each group entity frameworks
body: <p>I am trying to group a list of devices with mac addresses.  I have tried this in linqpad and it works successfully.  However when I try and run this in Entity frameworks I get an error saying "Specified method is not supported."</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var db = new centraliteEntitiews();
  
  var network = from n in db.infoes
                where (n.state != 2) || (n.nodeid != 0)
                orderby n.time
                group n by n.mac into g
                select g.FirstOrDefault();
  return View(network);
  </code></pre>
  
  <p>I would like it to return a list of object to send to my view.</p>
  
  <p>MacAddress  state  nodeid  uptime etc</p>