I want to make obejcts persistable which have arguments in their constructor. The System.Activator.CreateInstance(t) method called in CClassMap of course fails to do so...
Is there a way to pass a factroy method to the AToMSFramework? Or is there another workaournd?
Thank you very much,
Felix
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you create a factory that implements AtomsFramework.IClassFactory you can control the creation of objects (this is required for persisting interfaces for example). All you need to do in the class mapping in the XML file is include an XML attribute like factory="myClassFactory".
The problem you will have is that there are no parameters passed to the CreateObject method of the IClassFactory interface, which also means there will be no context provided for your factory.
- Richard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to make obejcts persistable which have arguments in their constructor. The System.Activator.CreateInstance(t) method called in CClassMap of course fails to do so...
Is there a way to pass a factroy method to the AToMSFramework? Or is there another workaournd?
Thank you very much,
Felix
Hi Felix,
Good question.
If you create a factory that implements AtomsFramework.IClassFactory you can control the creation of objects (this is required for persisting interfaces for example). All you need to do in the class mapping in the XML file is include an XML attribute like factory="myClassFactory".
The problem you will have is that there are no parameters passed to the CreateObject method of the IClassFactory interface, which also means there will be no context provided for your factory.
- Richard.