You can create 2 dictionaries to solve your issue like this.
The First one is <UserID, UserObject>, same as yours.
The Second one is <UserName, UserID>, which will save your client's user id and user name.
So in your code you can find UserID by UserName, then find its user object by UserID.
In this case you avoid having to update user object twice when it is changed. But the cost is you have to find UserID first if UserName is given.
I hope this helps.
Zac Bai, Mar 09, 2010
Mar 18, 2010