title: How to exclude certain enumerations from all enumeration types
body: <p>I am trying to exclude certain enumeration values such as <code>Unknown</code> and <code>Uninitialized</code> from the set of values for <em>any enumeration type</em>.</p>
  
  <p>I can see that <code>Enums</code> are generated in a round robin fashion using the <a href="https://github.com/AutoFixture/AutoFixture/blob/ab829640ed8e02776e4f4730d0e72ab3cc382339/Src/AutoFixture/EnumGenerator.cs" rel="nofollow noreferrer"><code>EnumGenerator</code></a> from the set of all possible <code>Enum</code> values for a given <code>Enum</code> type.</p>
  
  <p>Based on that code, my first thought is to build an <code>ISpecimenBuilder</code> that checks for <code>Type.IsEnum</code> and does a <code>context.Resolve(request)</code> until <code>Resolve</code> returns a value that is not on the excluded list.</p>
  
  <p>The problem is this gives me a recursion error. After inspecting the source code I understand why - if a builder handles a request and calls another <code>Resolve</code> again with the same request you will end up in an infinite loop.</p>
  
  <p>But as <code>EnumGenerator</code> is not extensible, and I can't figure out how to intercept the build chain I am stumped as to how to solve this.</p>