Hi,
I've migrated our source from v5.3 to v5.4.
I used in v5.3 the FieldInfoProviderSingleton and i noticed that this one disappeared in v5.4. So now i'm using then ModelInfoProviderSingleton.
I our program it is possible for users to add new fields in the database via the user interface, after that we call the FieldInfoProviderSingleton.Init() method again for reloading the fields (i've made this method public in FieldInfoProvider.cs).
With the FieldInfoprovider it was possible to "reload" the provider with the Init() method. When i want to reload the MethodInfoProvider i get the following error when this.AddElementFieldInfo is executed for the second time when the field already exists (see attachment).
The question is: how can i "reload" the provider at runtime?
I can't find a method to clear the Infoprovider first for example.
Extra information: I've added some custom code in the FieldInfoProvider.cs (and now in the ModelInfoProvider) to support additional fields.
Code fragement (see initCustomFieldsForEntity method on the bottom):
private void InitBouwBasislijstProductRelatieEntityInfo()
{
this.AddFieldIndexEnumForElementName(typeof(BouwBasislijstProductRelatieFieldIndex), "BouwBasislijstProductRelatieEntity");
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "ID", typeof(System.Int32), true, false, true, false, (int)BouwBasislijstProductRelatieFieldIndex.ID, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRKeyID", 0), 0, 10);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "BPKeyID", typeof(System.Int32), false, true, false, false, (int)BouwBasislijstProductRelatieFieldIndex.BPKeyID, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRBPKeyID", 0), 0, 10);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "PDRKeyID", typeof(System.Int32), false, true, false, false, (int)BouwBasislijstProductRelatieFieldIndex.PDRKeyID, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRPDRKeyID", 0), 0, 10);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "InvoerNaam", typeof(System.String), false, false, false, true, (int)BouwBasislijstProductRelatieFieldIndex.InvoerNaam, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRInvoerNaam", 255), 0, 0);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "InvoerDatum", typeof(Nullable<System.DateTime>), false, false, false, true, (int)BouwBasislijstProductRelatieFieldIndex.InvoerDatum, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRInvoerDatum", 0), 0, 0);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "WijzigNaam", typeof(System.String), false, false, false, true, (int)BouwBasislijstProductRelatieFieldIndex.WijzigNaam, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRWijzigNaam", 255), 0, 0);
this.AddElementFieldInfo("BouwBasislijstProductRelatieEntity", "WijzigDatum", typeof(Nullable<System.DateTime>), false, false, false, true, (int)BouwBasislijstProductRelatieFieldIndex.WijzigDatum, Tools.GetSourceColumnMaxLength("IMS_BasislijstenProdRel", "BPRWijzigDatum", 0), 0, 0);
// IDB specifiek: vrije velden toevoegen
initCustomFieldsForEntity("BouwBasislijstProductRelatieEntity", "IMS_BasislijstenProdRel");
}