I am converting this class
public class MyClass
{
public IEnumerable<string> Strings { get; }
public MyClass(IEnumerable<string>? strings = null)
{
Strings = strings ?? new List<string>();
}
}
To a record. Currently I have this:
public record MyRecord(IEnumerable<string>? strings = null);
However, I can't find a way to default initialize the IEnumerable to an empty enumerable, as it must be a compile time constant. I tried static initializing a readonly array, but same problem.