Linq你越来越慢

时间:2019-02-13 03:01:23

标签: linq

我进行一次linq查询,仅匹配两个表的主键group by和映射的产品,但是变慢了

int mappedCount = (from product in products
                                   from productMapping in DbContext.ProductCategoryMappings where product.TenantId.Equals(productMapping.TenantId.ToString())
                                   && product.ProductGuid.ToUpper().Equals(productMapping.ProductId.ToString().ToUpper())
                                   from tenantCustMapping in DbContext.TenantCustCategories
                                   where tenantCustMapping.Id.Equals(productMapping.Value)
                                   select 1).ToList().Sum();

产品映射的invoceindex为1,而映射的计数的最终和为

0 个答案:

没有答案