Reputation: 3491
I have the following block of code which should ultimately delete a record.
long id = 81;
SessionInstance.Delete("from Core.Domain.Model.Person as obj where obj.Id =:id", id, NHibernateUtil.Int64);
But after upgrade Nhibernate version to 3.3.3.4001, this code has a exception by this message :
The given key was not present in the dictionary.
Why?
Upvotes: 3
Views: 7473
Reputation: 14535
If you want to use positional parameters (which you need to), the syntax is a bit different:
session.Delete("from Product p where p.ProductId = ?", id, NHibernateUtil.Int32);
Upvotes: 3