Ok, it’s late and I am really, really tired right now so I hope I am not screwing up by labeling this a bug. I writing this now because I leave tomorrow for vacations and I am not sure when I will get the time to log this if not right now.
Ok, here is the deal. If you look at the “UndoableBase” class, there is a method called “GetFieldName”. The method body contains the following instruction:
return field.DeclaringType.Name + "!" + field.Name;
The problem with this is that this really needs to be:
return field.DeclaringType.FullName + "!" + field.Name;
The reason why it needs to be “FullName” is because someone can create a custom class called “BusinessBase” (the same name as what the CSLA uses) and add a field to this custom class using the same field name as one of the persistent fields of the CSLA “BusinessBase” properties. For example:
-----
MyNameSpace
class BusinessBase
{
private int EditLevel
}
-----
If someone does this, when the CSLA tries to copy the state you will be getting a duplicate key exception when trying to insert the value in the “HybridDictionary” collection.
Of course, this problem is more likely to occur if the code is obfuscated since the obfuscation process will try to rename the classes as short as possible so the possibility having conflicting names it’s much bigger with obfuscated code.
Thanks (I am going to sleep!!)
Any comments on this anyone?
Copyright (c) Marimer LLC