我获取了一个大集合(35k+ - 产品列表)
for each item_cache in products_cache
list.Add(New Products With {
.product_id = item_cache.id,
.product_name = item_cache.name,
.moreHere = item_cache.moreHere,
.moreHere = item_cache.moreHere,
.moreHere = item_cache.moreHere,
.moreHere = item_cache.moreHere
})
next
return list.Tolist
我们目前拥有的参数都是字符串(home.aspx?p_name='Shirts')。
在我拥有列表集合之后,是通过字符串搜索还是通过索引搜索更好?
return list.where(function(c) c.product_name = 'Shirts')
或者我应该先检索字符串的索引(PK)
Dim p_id As Integer = dataGetIdOfProduct('Shirts')
return list.where(function(c) c.product_id = p_id)