title: How to use Linq to check a list of objects property have allowed values from another list
body: <p>I have a class Person, in this class i have some properties. One of these properties is string Role.
  the user can input the role in an xml file that i should parse.
  I have a List of allowedRoles where the allowed roles are hardcoded. I want to check if the Role property and compare it to the allowedRoles list.
  I want to use linq to filter out the unallowed Roles.</p>
  <pre><code>public class Person
  {
     Public string Name {get; set;}
  
     Public string Role {get; set;}
  }
  </code></pre>
  <p>I have a list with allowed roles</p>
  <pre><code>var allowedRoles = new List&lt;string&gt;{&quot;Developer&quot;,&quot;Admin&quot;,&quot;Recruiter&quot;};
  </code></pre>
  <p>At a later stage i when i parsed the xml. I get a list of Person where i need to validate the role property against my AllowedRoles list. I dont want to use a loop. I would prefer using a linq expression to filter out the unvalid roles where Im left with a list of Persons that have the allowed roles.
  so I have a list of Person:</p>
  <pre><code>var persons = new List&lt;Person&gt;();
  </code></pre>
  <p>How do i use my AllowedRoles list to filter out the unallowed Roles from Persons?</p>