在linq 中实现 sql 中的in查询时,可以使用如下语句:

View Code

 /// 
        
 
        
 
        
 
         intPropertySetId)
 )
 ();
            }
 
 Ls.ToList();
<summary>/// 根据行业id获得属性集名
        
///</summary>///<param name="strPropertySetId"></param>///<returns></returns>public List<string> GetHyNametByPromotionForWeb(List<int?>        {
            
if (intPropertySetId.Count ==0            {
                
returnnew List<string>            var Ls = from p in _content.OP_Catalog
                     
where intPropertySetId.Contains(p.HYID) && p.parentCID =="0"                     select p.catalogName;
            
return        }

 

注意:类型要一致

 

 

 

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-08-18
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案