The object mapper by default sets all PK fields to ReadOnly.
In many cases in our application we are passing the values for the PK to the create method on a Business Object class.
In the example below ComponentId is the PK of IOComponentOption. How do I set this without changing all the field definitions in the Object Mapper for 500+ business objects? I assume I can use the SetColumnValue method but this is a lot of code to rewrite for almost every business object.
EXAMPLE:
public
static IOComponentOption Create(int componentId){
IOComponentOption option = Session.PM.CreateEntity<IOComponentOption>() as IOComponentOption;
option.ComponentId = componentId;
option.Data = String.Empty;
option.AddToManager();
return(option);
}