title: Dynamically insert an Enum Type as argument in a class constructor expecting <TEnum>
body: <p>I am trying to create a generic mapping function for GraphQL.NET. Here is the sample enum I'm using:</p>
  
  <pre><code>    public enum ForcePower
      {
          Throw,
          Pull,
          Choke,
          Lightning
      }
  
      public class Jedi 
      {
          public string Id { get; set; }
          public string Name { get; set; }
          public string HomePlanet { get; set; }
          public ForcePower Power { get; set; }        
      }
  </code></pre>
  
  <p>currently, the enum has to be passed in explicitly:</p>
  
  <pre><code>        object obj = new Jedi();
          PropertyInfo[] properties = obj.GetType().GetProperties();
  
          foreach (var propertyInfo in properties)
          {                
              var isEnum = propertyInfo.PropertyType.GetTypeInfo().BaseType == typeof(Enum);
  
              if (isEnum)
              {
                  var enumType = typeof(EnumerationGraphType&lt;ForcePower&gt;);
                  Field(type: enumType, name: propertyInfo.Name, description: description);
              }
  
          }
  </code></pre>
  
  <p>Can 'ForcePower' be passed in dynamically? </p>