title: Variable with enum datatype and not all values within contains value?
body: <p>I have variable allowedPlaceOfWork with datatype:</p>
  
  <pre><code>[Flags]
  public enum PlaceOfWOrk {
    CompanyOffice = 1 &lt;&lt; 0;
    ClientOffice  = 1 &lt;&lt; 1,
    HomeOffice    = 1 &lt;&lt; 2,
  ....
  }
  </code></pre>
  
  <p>and contains values:
  <code>ClientOffice</code> and <code>HomeOffice</code>.</p>
  
  <p>Also, I have <code>Employee</code> entity with <code>place of work</code> within, how can I check if employees <code>place of work</code> in allowedPlaceOfWork?</p>
  
  <p>I've tried to use <code>Enum.IsDefined</code> but it works with all enum, I have just some values of it.
  Also, I have an idea to convert it to <code>IEnumerable</code> and check values within the collection but in this case, I have to convert from enum to collection.</p>
  
  <p>Is there any way to check it without converting?</p>