Clone method of ResultSetFields raises exception "An item with the same key has already been added"

Posts   
 
    
DvK
User
Posts: 318
Joined: 22-Mar-2006
# Posted on: 06-Jun-2013 11:48:59   

Clone method of ResultSetFields object raises exception "An item with the same key has already been added".

fields = baseFields.Clone

Stacktrace

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value) at SD.LLBLGen.Pro.ORMSupportClasses.EntityFieldsCore1.set_Item(Int32 index, TField value) at SD.LLBLGen.Pro.ORMSupportClasses.EntityFieldsCore1.CreateDeepClone() at SD.LLBLGen.Pro.ORMSupportClasses.EntityFields2.Clone()

Same code worked fine in v3.5 but fails in latest version of v4.0. SD.LLBLGen.Pro.ORMSupportClasses.dll -> 4.0.13.0527

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 06-Jun-2013 11:58:54   

In all cases, or in specific cases?

Frans Bouma | Lead developer LLBLGen Pro
DvK
User
Posts: 318
Joined: 22-Mar-2006
# Posted on: 06-Jun-2013 12:02:12   

All cases... cry For reproduction : simply construct a filled ResultSetFields object and perform a clone.

DvK
User
Posts: 318
Joined: 22-Mar-2006
# Posted on: 06-Jun-2013 12:08:03   
        Dim fl As New ResultsetFields(2)
        fl.DefineField(AccountFields.AccountId, 0)
        fl.DefineField(AccountFields.AccountName, 1)
        Try
            fl.Clone()
        Catch ex As Exception
            Debug.Write("test")
        End Try
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 06-Jun-2013 14:25:01   

We'll look into it!

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 06-Jun-2013 14:40:52   

Fixed in next build, which will be up in an hour or so. (have to fix another bug before we can release it).

Frans Bouma | Lead developer LLBLGen Pro