This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need assistance with MultiValueProperty sorting methods

I need to sort an MVP before writing to AD.  Can anyone help me with the syntax for using the SortTopDown and SortBottomUp extension methods of MultiValueProperty?  I am not a .net programmer and am having difficulty understanding the documentation provided.

<ExtensionAttribute> _
Public Shared Function SortBottomUp(Of T, TKey) ( _
	input As IEnumerable(Of T), _
	keySelector As Func(Of T, TKey), _
	parentKeySelector As Func(Of T, TKey) _
) As IEnumerable(Of T)

What would I pass as the keyselector functions?

Dim mvpRoles As MultiValueProperty = New MultiValueProperty("a|d|c|b", "|")

Return mvpRoles.SortTopDown(???????)

Parents
  • I assume you want to use that in a scripted property of a synchronization project?

    What version?

    This code should do the trick:

    Dim mvpRoles As MultiValueProperty = New MultiValueProperty("a|d|c|b", "|"c)
    Dim sorted = mvpRoles.OrderBy(Function(s) s).ToArray()

Reply
  • I assume you want to use that in a scripted property of a synchronization project?

    What version?

    This code should do the trick:

    Dim mvpRoles As MultiValueProperty = New MultiValueProperty("a|d|c|b", "|"c)
    Dim sorted = mvpRoles.OrderBy(Function(s) s).ToArray()

Children
No Data