using linq not exists vb.net

HI,

I have the following function that I cant quite get right as am still relatively new to linq:

Basically the costume group that is being passed in has a property costumes

The generalhelper.costumes returns a linq.tables(of costumes), the same as the costumes property on group.

What I want to say is get the generalhelper.costumes that dont exist in group.costumes.

How dod I do this.

Can the code be in vb.net please.

Thanks
Public Function GetCostumesNotLinkedToGroup(ByVal group As CostumeGroup) As ....
        Try
            Dim query = GeneralHelper.Costumes.Where....
            Return query
        Catch ex As Exception
            Throw
        End Try
    End Function

Open in new window

scm0smlAsked:
Who is Participating?
 
käµfm³d 👽Commented:
Perhaps:

Dim query = GeneralHelper.Costumes.Except(group.Costumes)

Open in new window

0
 
nepaluzCommented:
Dim query = From x As Costume in GeneralHelper.Costumes() Not Where group.Costume.Contains(x) Select x
Return query

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.