According to the REST philosophy, a request PUTmust update a resource at a URL if it exists, and create it if it does not exist. In other words, if I use the following URL:
PUT http://server/item/5
If exists Itemwith identifier 5, it will be updated. If it Itemdoes not exist with identifier 5, a new one Itemwith identifier 5 will be created .
However, I use NHibernate for persistence, and I have mapped my identifiers as Identity. This means that no matter what value I assign to the identifier, NHibernate will replace it with its own when I save the new one Item.
How do I get NHibernate to save Itemwith the identifier that I assigned to it, without changing the identifier mapping to Assigned?
source
share