Sorting on C# arrays using OrderBy
I am using the OrderBy to create a new sorted array as suggested in the
post Sort array of items using OrderBy<> .
var sorted = sharepointList.OrderBy(item => item.GetTabOrder()).ToArray();
where, sharepointList is the array of objects that contains attributes
including int tabOrder and GetTabOrder is the getter for the 'tabOrder'
attribute
But this throws the below Exception. Please help
NullReferenceException
Object reference not set to an instance of an object.
Thanks in advance, Sagarika
No comments:
Post a Comment