title: C# enum type shared multiple classes
body: <p>I am trying to find what is the most elegant way to handle the below situation:</p>
  
  <pre><code>class ObjectA
  {
      public enum MandatoryParameters {A, B, C}
      public enum OptionalParameters {D, E, F}
  }
  class ObjectB
  {
      public enum MandatoryParameters {G, H, I}
      public enum OptionalParameters {J, K}
  }
  class Error
  {
      MandatoryOrOptionalParameters param;
      string errorDescription;
  
      Error(MandatoryOrOptionalParameters p, string d)
      {
          param = p;
          errorDescription = d;
      }
  }
  </code></pre>
  
  <p>Is there any good way to create a <code>MandatoryOrOptionalParameters</code> type to avoid <code>string</code>? I read the few related message <a href="https://stackoverflow.com/questions/13734746/combine-multiple-enums-into-master-enum-list">here</a> and <a href="https://stackoverflow.com/questions/19582477/combining-enum-values-with-bit-flags">here</a>. </p>