Set value to [Flags] Enum from list c# -


I need to set the value of the values ​​taken from the list.

I have Enum:

 [flags] public enum EnumTest {Val1 = 1, Val2 = 2, Val3 = 4}   

var value = new list & lt; EnumTest & gt; {EnumTest.Val1, EnumTest.Val3};

How can I get the following results using an advance?

  var result = EnumTest.Val1 | EnumTest.Val3;   

Thanks

Here's a solution using the link: var result = value. Apply ((x, y) => x | = y);

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -