string[] _myStrings = { "Hello", "There", "Happy", "Day" };
public IEnumerable<string> MyStrings1
{
get
{
return new System.Collections.ObjectModel.ReadOnlyCollection<string>(_myStrings);
}
}
public IEnumerable<string> MyStrings2
{
get
{
return from s in _myStrings select s;
}
}
I have seen some discussion about not using arrays for public properties.
I have been using the MyStrings2
Convention. Is there some reason I should be using MyStrings1
instead?