I have a model with a enum property. When I call my service, the model is returned back, and my enum-property contains the following data: Test1 | Test2 | Test3
.
I want to loop through the propery and assign the values to a list.
How can I do this with an enum propery?
var form = await _formService.GetById()
;
That code above generates a result with a enum property called Sections with th data that I provided above, but I don't know how to loop through It to get the values.
Here is my Enum:
[Flags]
public enum Sections
{
Test1= 0,
Test2= 1,
Test3= 2,
Test4= 4,
}