How to initialize a list of strings (List) with many string values

Just remove () at the end.

List<string> optionList = new List<string>
            { "AdditionalCardPersonAdressType", /* rest of elements */ };

Leave a Comment