【发布时间】:2020-08-28 23:59:00
【问题描述】:
我需要从主表查询主明细中的记录。我有purchases 表和purchases detail 表,我需要咨询包含产品集合的购买。
模型参数:
public class PurchaseParmsDto
{
public ICollection<Int32> ProductsId { get; set; }
}
查询:
var query = (from p in _context.Purchase
where p.DetailPurchase.Where(x => purchaseParms.ProductsId.Contains(x.IdProducto))
select new...)
运行查询时出现此错误:
严重性代码描述项目文件行状态已删除
错误 CS0029 无法隐式转换类型'System.Collections.Generic.IEnumerable' en 'bool'
ApplicationComercio D:\Proyectos\AppComercioMultiApi\ApplicationComercio\Controllers\PurchasesController.cs 163 活动
你能帮帮我吗?谢谢
【问题讨论】:
-
您能发布完整的查询吗?很难看出你想用那个来实现什么
-
如果可以帮助到这里,也可以看看stackoverflow.com/questions/14627196/…
标签: c# sql entity-framework entity-framework-core