Home SO STRANGE ERROR: on custom class adding "a new item" to a property adds to all record in LIST(OF Custom_Class ).SELLERS Records
Reply: 0

SO STRANGE ERROR: on custom class adding "a new item" to a property adds to all record in LIST(OF Custom_Class ).SELLERS Records

FEBitAnya
1#
FEBitAnya Published in 2017-12-07 21:40:50Z

BEFORE ADD A SELLER:

reclict(0).SELLERS.count =0

reclict(1).SELLERS.count =0

.

reclict(N).SELLERS.count =0

reclict.First.SELLERS.Add( new Seller() WITH {.NAME="1.SELLER"})


THIS CODE ADD A RECORD TO reclict(0).SELLERS BUT ADDS save Record TO ALL reclict.SELLERS SAME VALUE

reclict(0).SELLERS.count =1: seller: .name= "1.SELLER"

reclict(1).SELLERS.count =1: seller: .name= "1.SELLER"

.

reclict(N).SELLERS.count =1: seller: .name= "1.SELLER"

<DataContract> <DataObject> <DisplayName("AssistOf_StokKART")>
<HighlightedClass> <[Alias]("ASSISTOF_STOKKART")> Friend Class AssistOf_StokKART

<Ignore, IgnoreDataMember> Public Property Seller As New List(Of Seller)

END CLASS


'
' on form 
'

Imports System.Data.Entity
Imports System.ComponentModel
Imports ServiceStack
Imports ServiceStack.OrmLite
Imports FirebirdSql.Data.FirebirdClient
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraBars
'
Imports FEBitINC.HELPERS
Imports FEBitINC.HELPERS.ActionHistory
Imports FEBitINC.Assist.StokKart_Assist.Importer.MyApp_Module
'
Imports DB
Imports DBTypes
Imports DB.Importer
Imports DevExpress.XtraGrid
Imports HELPerS
'Imports System.IO
Partial Friend Class form_Import_PriceList_Updater
.
.
public recList as list(of assist_stokkart)
'
sub generate_dummy_Data()
reclict.add( new assist_stokkart () )
reclict.add( new assist_stokkart () )
reclict.add( new assist_stokkart () )
reclict.add( new assist_stokkart () )
end sub
'
'
sub prepare_it()
'

reclict.First.SELLERS.Add( new Seller() WITH {.NAME="1.SELLER"})

'
end sub
.
.

end class
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.365473 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO