This rule is not absolute. Understand where it came from: a property that returns an array must make a copy so that the caller can change its copy and not get into the internal state of the object.
If you are dealing with generic code whose generic code knows nothing about a particular T It does not depend on its internal structure. Therefore, sticking to this rule does not help. Passing arrays to and from shared code is completely acceptable.
Case Study: A List<int[]> .
In addition to this, Servy correctly points out that creating methods to get / set the value does not actually do anything to mitigate the effects described in the reasoning for the rule.
source share