S
steve bull
If I create an array, e.g. private int[] x, inside a parent class whose elements can be accessed by a child class - what is the
recommended way of doing this?
When I create a property for the array FxCop complains that properties should not return arrays. If I want to make the array
private, which FxCop insists I do as well, is the only way of accessing the array elements via a method?
See e.g. http://www.gotdotnet.com/team/fxcop...formance/PropertiesShouldNotReturnArrays.html
the FxCop explanation describes what not to do but there is no explanation of what should be done instead.
Having Googled this I see that quite a number of people give the wrong way to do it and nobody seems to deal with the problem -
which seems to me to be a pretty basic one.
Thanks,
Steve
recommended way of doing this?
When I create a property for the array FxCop complains that properties should not return arrays. If I want to make the array
private, which FxCop insists I do as well, is the only way of accessing the array elements via a method?
See e.g. http://www.gotdotnet.com/team/fxcop...formance/PropertiesShouldNotReturnArrays.html
the FxCop explanation describes what not to do but there is no explanation of what should be done instead.
Having Googled this I see that quite a number of people give the wrong way to do it and nobody seems to deal with the problem -
which seems to me to be a pretty basic one.
Thanks,
Steve