本文介绍了对多对多关系的查询失败不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 您好,   我创建了包含2个实体的实体框架模型(包含EF3),其中包含许多 - 多对多关系(例如产品< - >订单)。该关系由DB中的3个表覆盖。 我正在尝试使用所有订单查询Product(使用包含Product对象的方法)。   结果是不存在的:在大多数情况下,查询会生成所有相关对象(产品和订单),但在某些情况下,产品并没有退回订单(对于同一产品) )。   任何想法如何解决这样的谜团? :):):) 跟踪问题的有效方法是什么?     谢谢, 标记解决方案 Hi, I created Entity Framework model (with EF3) with 2 entities governed by many-to-many relation (e.g. Products <-> Orders). The relation is covered by 3 tables in DB.I'm trying to query Product with all Orders (using Include method with Product object). The result is incosistent: in most cases the query produces all the related objects (Product and Orders), however in some cases a product and no orders returned (for the same product). Any ideas how to resolve such a mystery? :):):)What is a efficient way to trace the problem?  Thank you,Mark 解决方案 这篇关于对多对多关系的查询失败不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 10:13