In a C# application the following array is used:
CProject[] projectArray = this.proxy.getProjectList(username, password);
However I need the projectArray
as a ObservableCollection<CProject>
. What would be the recommended way to do this? So far I'm using the following statement:
ObservableCollection<CProject> projectList = new ObservableCollection<CProject>(projectArray);
Would you also use this statement or would you recommend other ways?
Building a new collection from an IEnumerable
as you did is the way to do it.