A dropdown populated with values found in an enumeration can be a quick and efficient component. Quick in that it doesn’t take long to code (no need to write database access code to populate the list) and efficient because all the values are in memory (no resources are expended to fetch the list values).
I believe binding the string value to a property would be the most common use case however sometimes you might want to bind the integer value of the enumeration to a property. Rather than have one complicated component that can handle both requirements (bind to string or bind to int) it seems to me it would be better to have separate versions for each. So I’ve created another version that allows binding to the integer value of the enumeration. I’ve named it SelectEnumBindIntBCA.
You can play with it and get the code at Blazor Component Authority Demonstration. You’ll also find all the other components I’ve created so far for this project there along with the code for the demonstration examples. If you find any of the components there useful or have a suggestion for improvement please leave a comment. Thanks for reading.