LLBLGen runtime version 5.1.1
When I clear a pre-fetched detail collection, before the (re)fetch details, of a particular entity I become an exception: "Collection was modified; enumeration operation may not execute" (stack trace below)
Hoe can I find the cause of the problem? I know that clear is different then RemoveAt construction.
Fail code:
aDrawingSet.EplanWiringDiagramVersions.Clear();
Working code:
try
{
for (int idx = aDrawingSet.EplanWiringDiagramVersions.Count - 1; idx >= 0; idx--)
aDrawingSet.EplanWiringDiagramVersions.RemoveAt(idx);
}
catch (Exception ex)
{
int aap = 2;
}
stack trace:
At EDBDataStore.cs:line 997: aDrawingSet.EplanWiringDiagramVersions.Clear();
StackTrace
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore`1.Clear() in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Core\CollectionCore.cs:line 412
at CATENA.EDBDataStore.FetchEplanWiringDiagramVersion(DrawingSetsEntity aDrawingSet) in C:\Projecten\CATENA_Client_SVN\CATENA\Classes\EDBDataStore.cs:line 997
at CATENA.DataControllers.DrawingSetsDetailed.GenerateContent() in C:\Projecten\CATENA_Client_SVN\CATENA\Classes\DataControllers\DrawingSetsDetailed.cs:line 790