title: How to get all the enums in my project as JSON
body: <p>I am building an ASP.NET Web API application and I need to provide an HTTP GET endpoint that returns all the enums in my project as shown in the following sample:</p>
  
  <pre><code>{
      "code": 200,
      "message": "OK",
      "data": [
          {
              "EnumNameOne": {
                  "attributeName1": value,
                  "attribute2": value
              },
              "EnumNameTwo": {
                  "attributeName1": value,
                  "attribute2": value,
                  "attributeName3": value
              }
          }
      ]
  }
  </code></pre>
  
  <p>I know I've got to use reflection, but how can I structure my classes to have the output as in the JSON payload above?</p>