我有这样一个电话,Object.GetType()抛出一个错误
SomeList.Fetch(x => SomeCondition).OrderBy(x => x.GetType().GetProperty(sort).GetValue(x, null))
我得到一个Object reference not set to an instance of an object at System.Object.GetType()
。
任何想法可能会造成这种情况?这经常发生,并且只在生产中发生。
谢谢。
序列输出'取'包含一个空元素。 – Lee