title: Using Linq to return groupId
body: <p>I have this class :</p>
  
  <pre><code>public class Person
  {
     public int Id { get; set; }
     public string UserName { get; set; }
     public int GroupId { get; set; }     
  }
  </code></pre>
  
  <p>How do I do if I want to return <code>GroupId</code> if I have given <code>Id</code> .. like</p>
  
  <pre><code>public Person GetGroupId (int id)
  {
      return  _context.Person.Where(c =&gt; c.Id == id)
                             .Select(x =&gt;  x.GroupId)
                             .FirstOrDefault();
  }
  </code></pre>
  
  <p>But this giving me error message like "cannot implicitly convert type".</p>