1
Vote

Problem with readonly Properties

description

When the target entity has readonly properties you have to exclude them with the skipDestinationProperties collection. This can be quiet tedious, especially with huge object trees.
I would find it more sensible to exclude the readonly properties from mapping by default. I suggest to changed DataTransferObjectManager line 52
 
if (!skipDestinationProperties.Contains(destinationProperty.Name))
             destinationProperty.SetValue(destination, sourcePropertyContent, null);
 
to
 
if (!skipDestinationProperties.Contains(destinationProperty.Name))
 if (destinationProperty.CanWrite)
         destinationProperty.SetValue(destination, sourcePropertyContent, null);
 
 
Does that make sense to you?
 
Greetings
 
Stefan

comments