Hello,
in old LLBL version EntityFields2 was able to accept fields with the same name.
For example:
EntityFields2 fields2 = new EntityFields2(2);
fields2.DefineField(FormFields.ChangeDate, 0);
fields2.DefineField(DocumentFields.ChangeDate, 1);
However its not the case anymore in the new version. This code now result to exception:
System.ArgumentException : An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityFields2.set_Item(Int32 index, IEntityField2 value)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityFields2.DefineField(IEntityField2 fieldToAdd, Int32 indexInFields)
at ESG.Shared.UnitTests.PrintingManagement.CoreDALTests.TestGetExtraFieldCurrentValue() in CoreDALTests.cs: line 292
Why this was changed? As I understand, fields with the same name but different index still can exists, or?
If fields are added twice from the same table, it also can have different Alias, which may be set later..
It will be quite hard to find all the places, where it is used in this way...
Any suggestions? Should I start digging through all code base or its a bug in LLBL?
thank you.