title: Can SELECT and WHERE LINQ clause be combined?
body: <p>Here is what I have done to <code>Select</code> users into my model and then remove all the <code>null</code> records:</p>
  
  <pre><code>        model.Users = users
              .Select(u =&gt;
          {
              var membershipUser = Membership.GetUser(u.UserName);
              return membershipUser != null
                  ? new UserBriefModel
                  {
                      Username = u.UserName,
                      Fullname = u.FullName,
                      Email = membershipUser.Email,
                      Roles = u.UserName.GetRoles()
                  }
                  : null;
          })
              .Where(u =&gt; u != null)
              .ToList();
  </code></pre>
  
  <p>Wondering if there is a way to combine the <code>SELECT</code> and <code>WHERE</code> clause. </p>
  
  <p>I tried:</p>
  
  <pre><code>        model.Users = users
              .Select(u =&gt;
              {
                  var membershipUser = Membership.GetUser(u.UserName);
                  if (membershipUser != null)
                      return new UserBriefModel
                      {
                          Username = u.UserName,
                          Fullname = u.FullName,
                          Email = membershipUser.Email,
                          Roles = u.UserName.GetRoles()
                      };
              })
              .ToList();
  </code></pre>
  
  <p>But the intellisense suggest a syntax error. Which forces me to add a <code>return null</code> statement:</p>
  
  <pre><code>        model.Users = users
              .Select(u =&gt;
              {
                  var membershipUser = Membership.GetUser(u.UserName);
                  if (membershipUser != null)
                      return new UserBriefModel
                      {
                          Username = u.UserName,
                          Fullname = u.FullName,
                          Email = membershipUser.Email,
                          Roles = u.UserName.GetRoles()
                      };
                  return null;
              })
              .ToList();
  </code></pre>
  
  <p>So what is the correct way to write this <code>SELECT</code> statement so only valid records are selected into my model?</p>