www.webdeveloper.com
Results 1 to 2 of 2

Thread: how to extend join in linq...

  1. #1
    Join Date
    Mar 2007
    Posts
    101

    Question how to extend join in linq...

    How can i extend or create dynamic join in linq?

    Code:
    IEnumerable<DataRow> drModel = from cModels
                                                  select cModels;
    
    if (true){
        drModel = drModel.Join(my statement for join);
    }
    but I manage the dynamic where like this

    Code:
    drModel = drModel.Where(cModels => cModels.Field<Int64>("Id") == Convert.ToInt64(Id));
    Can anybody help me?

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Hi,

    here is a link to a msdn post where there is a good example of a join within a linq query. You should be able to use that to build your own join.

    http://social.msdn.microsoft.com/For...a-a4b997108ffd

    Hope that helps.


    regards

    Ribs

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles