0
可能重複:
How to do a join in linq to sql with method syntax?如何使用join()方法表達
如何使用join()方法表達?
/// <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();
}
我想與Province
和country
加入。我知道如何使用「From .. in .. join..
」做,但沒有與此表達Join(???)
看看這個:http://stackoverflow.com/questions/3217669/how-to-do -a-join-in-linq-to-sql-with-method-syntax –
非常感謝你!這是我的解決方案 –