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 –
非常感谢你!这是我的解决方案 –