How to delete an object by using PK in nhibernate?

后端 未结 5 1233

How do I delete an object without fetching it from the db first?

In another ORM, I can do this:

session.Delete(1); // 1 = PK
5条回答
  •  无人共我
    2021-02-02 17:17

    prior to ver 2 there wasn't a way. After ver 2 you have the ExecuteUpdate() method on IQuery and there is an overloaded method on ISession.Delete() where it accepts a string that defines a deletion query

提交回复
热议问题