L
Larry Bud
I have a function which return a List, and I'm trying to add users to
it from 3 different roles, but I don't want duplicate user names. The
"Contains" ALWAYS is returning FALSE, so I'm not finding the dupe.
Here's the code:
Dim datalist As New List(Of TroubleTicketUser)
Dim str As String
Dim theroles(2) As String, therole As String
theroles(0) = "IT User"
theroles(1) = "IT Admin"
theroles(2) = "Customer Service Rep"
For Each therole In theroles
For Each str In Roles.GetUsersInRole(therole)
Dim tt As New TroubleTicketUser(str)
If Not datalist.Contains(tt) Then datalist.Add(tt)
Next
Next
datalist.Sort()
Return datalist
it from 3 different roles, but I don't want duplicate user names. The
"Contains" ALWAYS is returning FALSE, so I'm not finding the dupe.
Here's the code:
Dim datalist As New List(Of TroubleTicketUser)
Dim str As String
Dim theroles(2) As String, therole As String
theroles(0) = "IT User"
theroles(1) = "IT Admin"
theroles(2) = "Customer Service Rep"
For Each therole In theroles
For Each str In Roles.GetUsersInRole(therole)
Dim tt As New TroubleTicketUser(str)
If Not datalist.Contains(tt) Then datalist.Add(tt)
Next
Next
datalist.Sort()
Return datalist