wolli wrote:
Sounds like you try to change the id of the department
sysPerson.SysDepartment.Id = "002";
That's not possible, you have to set the complete object:
sysPerson.SysDepartment = department002;
Thanks to wolli. I did the same way you suggested, but the result let me down. I thought the problem may be the my SysPerson instance and SysDepartment instance
come from different ISession. So when I set the sysPerson.SysDepartment = department002,NHibernate try to change the original SysDepartment by update its ID by department002. I go into the break point, I also found that when I have done sysPerson.SysDepartment = department002,I couldn't get the all SysDepartment from ISession,because of the same problem:
identifier of an instance of Authorization.SysDepartment was altered from 001 to 002. I need the operation which load all SysDepartments information from New ISession for user to change the SysPerson's property SysDepartment that come from first ISession. Any one have suggestion for help me out.