我有以下方法: -
public IQueryable<ComponentDefinition> GetProducts(string[] type)
{ return entities.ComponentDefinitions.Where(a => a.ComponentType.COMPONENTTYPENAME.ToLower() == type.ToLower());
}
但我不确定如何添加诸如,所以 where 将包含字符串数组:- :-
public IQueryable<ComponentDefinition> GetProducts(string[] type)
{ return entities.ComponentDefinitions.Where(a => a.ComponentType.COMPONENTTYPENAME.ToLower() == type.ToLower().Any(type));
}