I used the DefaultValue attribute in a code generator that writes a C # class definition from a schema.
I am stuck where the property in the schema is an array of strings.
I would like to write something like this in my C #:
[DefaultValue(typeof(string[]), ["a","b"])]
public string[] Names{get;set;}
but it will not compile.
Is it possible to successfully declare a default attribute for a string array?
source
share