Share via


BindingSource.SortDescriptions가 null을 반환하지 않습니다.

데이터 원본이 IBindingListView가 아닌 경우 null 대신 빈 ListSortDescriptionCollection을 반환하도록 BindingSource.SortDescriptions가 업데이트되었습니다.

도입된 버전

.NET 9 미리 보기 1

이전 동작

이전에는 데이터 원본이 IBindingListView가 아닌 경우 BindingSource.SortDescriptionsnull을 반환했습니다.

새 동작

.NET 9부터 BindingSource.SortDescriptions는 데이터 원본이 IBindingListView가 아닌 경우 빈 ListSortDescriptionCollection을 반환합니다.

범주 변경

이 변경 사항은 동작 변경입니다.

변경 이유

이전 동작은 올바르지 않습니다.

데이터 원본이 IBindingListView가 아닌 경우 BindingSource.SortDescriptions는 역사적으로 null을 반환했습니다. 그러나 BindingSource.SortDescriptions는 반환 형식이 null을 허용하지 않는 IBindingListView.SortDescriptions를 구현합니다. 구현하는 인터페이스에 맞추기 위해 BindingSource.SortDescriptions는 대신 빈 ListSortDescriptionCollection을 반환하도록 변경되었습니다.

코드가 어떤 이유로든 BindingSource.SortDescriptions에서 null을 예상하는 경우 대신 빈 ListSortDescriptionCollection을 예상하도록 코드를 업데이트합니다.

영향을 받는 API