Open Ernest314 opened 2 years ago
Also initialize properties as such where possible:
public List<string> Data { get; } = new ();
readonly
should only modify fields (not properties) and struct
s (including record struct
s)--avoid using in other contexts.
See:
This includes using things likepublic object Data { get => Object.Data; }
instead ofpublic object Data => Object.Data;
.Edit: These two are actually equivalent.