c# - nhibernate saves objects it shoudn't -
i have listeners nhibernate preupdate , other stuff. fire correctly.
i do:
var model = populatedetailsviewmodel(user, id); _viewhistoryworkerservice.addobjecttohistory(id, user.tenantid, user.userid, "individual", user.isemulated);
i populate view model individual's data there lot of entities loaded there fill in detailsviewmodel. in method addobjecttohistory add history object.
newhistory = new history(); newhistory.objectaccessedon = datetime.now; newhistory.objectid = objectid; newhistory.tenantid = tenantid; newhistory.userid = userid; newhistory.objectname = type; _historyrepository.saveorupdate(userid, newhistory);
the problem when saveorupdate done update history entity in preupdate hibernate event kind of attempts save kind of entities loaded populate detailsviewmodel , not modified.
the problem why nhibernate updates entities not modified?
Comments
Post a Comment