Unable to create a constant value - only primitive types

前端 未结 4 1847
北荒
北荒 2020-11-30 08:25

Two simple queries - the exception occurs in :

matchings.Any(u => product.ProductId == u.ProductId)

What is wrong? If I write true

4条回答
  •  情深已故
    2020-11-30 09:25

    This looks like a place to use join

     var query =
        from product in db.Products
        join matching in db.Matchings
        on product.ProductId equals matching.ProductId into matchGroup
        where matchGroup.Count() > 0 and matching.StoreId == StoreId
        select product;
    

提交回复
热议问题