Automapping read only non-ID properties
Hi,
Thanks for a great tool.
I'm in the process of switching from classic hbm-mapping to automapping.
I have an issue with read only properties, that aren't id:s. It seems the GetAccessStrategyForReadOnlyProperty method is not called for regular properties.
I have some properties that I absolutely want to keep read only, how can this be achieved with automapping?
2 Posted by Andreas Folkesson on 18 Jun, 2010 09:16 AM
I solved this by adding a convention:
public class ReadOnlyConvention : IPropertyConvention
But I would be much happier if the PropertyStep.GetPropertyMapping method called the GetAccessStrategyForReadOnlyProperty method in the IAutomappingConfiguration. That would save me a convention and I wouldn't repeat myself.