title: Filter null properties from list using Linq
body: <p>I have a method that accepts a variable that has a list of properties connected to it. What I need to do is create a linq query that will flag the current variable coming in as missing an "address" and add it to a list.</p>
  
  <pre><code>    public void Teachers(List&lt;Teacher&gt; teachers)
      {
          foreach (Name name in teachers)
          {
              int age = program.CalculateAge(name.BirthDate.Year);
  
              Name address = FilterAddress(name);
  
              // Output Teachers Name - First Name, Last Name
              if (name.Type.Equals(Name.NameType.Teacher))
              {
                  OutputToConsole(name.FirstName, name.LastName, age);
                  program.WriteAddress(name);
              }
          }
          Console.WriteLine();
      }
  </code></pre>
  
  <p>Above is the method that will add the current variable in foreach loop to the FilterAddress Method. Below is where the variable is being passed. This variable has a List property named "Address" that is connected to it. This address can be null. I need to select each name with an address of null and add it to a list. But as you guessed, my LINQ code below doesn't work and just breaks. </p>
  
  <pre><code>    public Name FilterAddress(Name name)
      {
          var NullItems = name.Select(x =&gt; x.Addresses).OfType&lt;Name&gt;();
  
          return NullItems;
      }
  </code></pre>