Open
Description
The generated code should follow the general API design pattern related to MA0016.
There many places in the generated code which could use abstractions instead of the concrete types. This will make it easier for us to change implementation details in the future without introducing a breaking change.
This issue should serve as a parent feature for updating all the parts of the code that can generate a collection type.
- All "result" types should take an IEnumerable<T> as input instead of List<T>. #99 All "result" types should take an
IEnumerable<T>
as input instead ofList<T>
.
Non-breaking change. - All "parameter" types should use
IReadOnlyList<T>
for array properties instead ofList<T>
. The default value assigned to these should beArray.Empty<T>
. E.g.:public IReadOnlyList<string> Items { get; set; } = Array.Empty<string>()
Breaking change. - All "model" types should use
IReadOnlyList<T>
for array properties instead ofList<T>
. The default value assigned to these should beArray.Empty<T>
. E.g.:public IReadOnlyList<string> Items { get; set; } = Array.Empty<string>()
Breaking change.
Related: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0016.md