LINQ subquery “NOT IN” problem

后端 未结 2 1377
庸人自扰
庸人自扰 2021-01-06 10:49

I do not understand why this query fails.

var qTags = from tagsU in _context.ADN_ProductTagsView
where !(from o in _context.ADN_ProductTagsView
        where         


        
2条回答
  •  伪装坚强ぢ
    2021-01-06 11:07

    It seems that the implementation of the QueryProvider you're using isn't complete. I'm not familiar with the QueryProvider you're using, but maybe you can try something like this:

    var qTags = from tagsU in _context.ADN_ProductTagsView
    where !(from o in _context.ADN_ProductTagsView
            where o.ProductID == productId
             select o.ProductTagID).Any(tagId => tagId == tagsU.ProductTagID)
    select tagsU;
    

    Hope that helps

提交回复
热议问题