如何编写匹配该查询的 NHibernate 条件?
select * from InventoryItems i
where not exists (select inventory_id from InventoryItemCategories c where i.id = c.inventory_id and c.Category_Id = '805cec1e-1d7b-4062-9427-a26d010f4fb3')
我已经写了这个,但不存在只需要一个参数!
DetachedCriteria detachedCriteria =
DetachedCriteria.For(typeof (InventoryItemCategories))
.SetProjection(Projections.Property("Catgory_Id"));
var criteria=Session.CreateCriteria(typeof(InventoryItem)).
Add(Subqueries.NotExists(inventoryCategoryId,detachedCriteria));
非常感谢您提前提供的帮助