gpt4 book ai didi

c# - 有关 null 或空参数的 SortDescription 文档

转载 作者:太空宇宙 更新时间:2023-11-03 15:55:09 24 4
gpt4 key购买 nike

我正在使用 SortDescriptionICollectionView 进行排序。

我的数据是字符串,所以我天真地假设我可以使用 null"" 作为 propertyName 参数,因为没有属性(property)提供;所以我做了:

view.SortDescriptions.Add(new SortDescription(null, ListSortDirection.Ascending));

并且它在 null"" 上都按预期工作。

后来我检查了the documentation并发现:

The propertyName parameter cannot be null
The propertyName parameter cannot be empty

在这两种情况下,它都应该抛出异常。

那么我是不是漏掉了什么,或者 MS 暑期实习生没有正确完成工作?

最佳答案

看起来文档有误。你可以找到实现 here

关于c# - 有关 null 或空参数的 SortDescription 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23982273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com