How to convert Asp.NET Enum to Json array, so it can be used for knockout options binding?
Options I see: is to create some custom enum extender (create method ConvertToJson that converts enum to Json) and write
<script>
var myTypeEnum = @ConvertToJson(typeof(ClientTypeEnum)) ;
</script>
and then I can use
<select data-bind="options: myTypeEnum, ....></select>
But I believe there are better options, so I do need to write ConverToJson
method by myself?