I'd like to create a simple class property which can contain multiple values set from the outside. (Values are of the same type.) Example of property name and contained items:
KnownHidScanners
"\\?\ACPI#IDEA0100#4&b74a345&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}"
"\\?\HID#VID_045E&PID_071D&MI_00#9&e6a1767&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}"
Is there a standard approach in .NET for data type of such a multi-value class property?
When searching MSDN for multi-value property, I can find Properties with Multiple Values concept article which suggests PropertyValueCollection data type. But if you check the data type closer, it is too tightly related to ActiveDirectory.
Off hand I can implement property as
- array of type
- collection of type
- list of type
but which one is the most used approach in out-of-the-box .net objects when they need multiple-value properties? I'm not long enough with .NET ecosystem to observe what is generally used.
Note: this is not an opinion-based question. I'm asking developers who are long enough with the framework which approach is already used so I can get consistent with standards.
Edit: clarity was improved after first answerer wrote he misread the question