Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:14:38+00:00 2026-06-16T00:14:38+00:00

Possible Duplicate: How to do a join in linq to sql with method syntax?

  • 0

Possible Duplicate:
How to do a join in linq to sql with method syntax?

How do I use join() expression?

Here, my model edmx

    /// <summary>
    /// Searches the specified term.
    /// </summary>
    /// <param name="term">The term.</param>
    /// <returns></returns>
    public List<City> Search(string term, string countryAbbrev, string provinceAbbrev)
    {
        //if(!string.IsNullOrEmpty(country) && !string.IsNullOrEmpty(province))
        return context.Cities.join(????).Where(Cty => Cty.Name.Contains(term)).ToList();
    }

I would like to join with Province and country. I know How to do with “From .. in .. join..” but not with this Expression Join(???)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:14:38+00:00Added an answer on June 16, 2026 at 12:14 am

    you don’t need to do the join as the entities are already in relationship so you can use the navigation properties to get a list of related records

    For example to get all the cities for a province you can do the below:

    var citiesInProvince=context.Province.Single(x => x.id==*AnyID*)
                                 .Cities;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Transact-SQL shorthand join syntax? I ran across a T-SQL script that does
Possible Duplicate: LINQ: Join MySql and SQL Server tables I don't think it's possible
Possible Duplicate: SQL left join vs multiple tables on FROM line? SELECT messages.message_title, messages.message_content,
Possible Duplicate: In MySQL queries, why use join instead of where? Joins are always
Possible Duplicate: SQL - how to SELECT multiple tables and JOIN multiple rows from
Possible Duplicate: Difference between JOIN and INNER JOIN I have found some legacy SQL
Possible Duplicate: How to LEFT JOIN two tables with the same column name I
Possible Duplicate: array join() method without a separator I'm using .join() to convert my
Possible Duplicate: How to Join three tables I have 4 tables : folder (id_folder,name)
Possible Duplicate: Is there something wrong with joins that don't use the JOIN keyword

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.