using linq not exists

Posted on 2011-10-27
Last Modified: 2012-05-12

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 please.

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

Open in new window

Question by:scm0sml
    LVL 17

    Assisted Solution

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

    Open in new window

    LVL 74

    Accepted Solution


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

    Open in new window


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now