How use Inner JOIN IN ORM2010

2 posts, 0 answers
  1. kunal
    kunal avatar
    11 posts
    Member since:
    Jan 2009

    Posted 09 Aug 2010 Link to this post

    Hi

    Following query  return me a list of record......

    Select  ARM.ID,ARM.name from artist as A
    INNER JOIN artist_role As AR ON AR.artist_id = A.id
    INNER JOIN artist_role_master As ARM ON ARM.id = AR.artist_role_master_id

    I want this Query in .net Using ORM2010
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 10 Aug 2010 Link to this post

    Hi kunal,

     The requested LINQ query should be defined in the following way:


    var query =
        from artist in context.Artists
        join role in context.ArtistRoles on artist.Id equals role.ArtistId
        join master in context.ArtistRoleMaster on role.Id equals master.ArtistRoleMasterId
        select new { master.ID, master.Name };

    Hope that helps.


    Best wishes,
    Damyan Bogoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top