I'm getting my feet wet with Lambda expressions and it's rather overwhelming.
I have a UserPrincipal object called SelectedUser. I wish to get a sorted list of the user's groups
This is what I have so far but when I include that code my application's form flashes a few times and closes! Also, what is the significance of the "r" in the "Return From r" statement?
Code:Dim SortedGroups As PrincipalSearchResult(Of Principal) = GetSortedGroups(Me.SelectedUser.GetGroups()) Private Function GetSortedGroups(ByVal psp As PrincipalSearchResult(Of Principal)) As PrincipalSearchResult(Of Principal) Return From r In psp.OrderBy(Function(t) t.Name) End Function




Reply With Quote