Hello.. i am wondering if this is possible.. im using the adapter with a WCF...
_Public Function GetPackage(ByVal PackageId As Integer) As PackageEntity Implements IService1.GetPackage
Dim adapter As New DataAccessAdapter()
Dim Package As New PackageEntity(PackageId)
Dim path As PrefetchPath2 = New PrefetchPath2(CType(EntityType.PackageEntity, Integer))
path.Add(PackageEntity.PrefetchPathPackageMedia).SubPath.Add(PackageMediaEntity.PrefetchPathMedia)
adapter.FetchEntity(Package, path)
Return Package
End Function_
The above gets me the package...
then hopefully using a
_Function Update_Package(ByVal _Package As IEntity2, ByVal recursive As Boolean) As Boolean Implements IService1.Update_Package
Dim adapter As New DataAccessAdapter()
If adapter.SaveEntity(DirectCast(_Package, PackageEntity), False, recursive) Then
Return True
Else
Return False
End If
End Function_
i should be able to save my changes..
it is my understanding that after i get the package., i can modify it., and then send it back... and since the pk contains the value for the entity., it should save the changes made to it., and a recursive set to tru should update all 2nd level collections that were prefetched?
also..
in my client application... i am trying to remove / add items to the 2nd level collection by
For Each _packageMedia As PackageMediaEntity In _Package.PackageMedia
If _packageMedia.PackageMediaId = lv_selectedmedia.Items(0).Tag Then
lv_selectedmedia.Items(0).Remove()
_Package.PackageMedia.Remove(_packageMedia)
Exit Sub
End If
Next
i have a listview., and a remove button., once you selecte an item., and click remove it should be able to do a match and remove the item from the collection.,
is that correct? would the same apply if i did a add?
also... looking at the add function,. if i try to throw in dupes it should filter out the already existing ones? ( saw that somewhere in the manual... its what i want)