Hi there,
I have an entity that contains a few sub-collections. I am trying to add a new entity to a sub-collection and modify some fields in the main entity. I then want to save everything at once. I have tried using the entity's Save method but it doesn't seem to filter down to the sub-collections. Is this not the way it's supposed to work?
What I find I have to do is:
- get the collection from the main entity
- create a new entity for that collection and fill it
- save the collection using SaveMulti
- save the main entity
- refetch the entity
- re-bind the collection to the datagrid which picks up the new collection's entity but not the new entityId for it.
Am I doing something wrong? Why doesn't the entity's Save method filter down through the collections?
mClaim = New PANEL_MEMBER_CLAIMEntity(mClaimId)
mClaim.PM_PER_DIEM_HEARING(0).START_TIME_DELIBERATION = "12:00"
mClaim.PM_PER_DIEM_HEARING(0).END_TIME_DELIBERATION = "12:30"
Dim hearing As New PM_PER_DIEM_HEARINGEntity
hearing.START_TIME_DELIBERATION = "2358"
hearing.END_TIME_DELIBERATION = "2358"
mClaim.PM_PER_DIEM_HEARING.Add(hearing)
Dim count As Integer = mClaim.PM_PER_DIEM_HEARING.SaveMulti()
Dim bRc As Boolean = mClaim.Save()
mClaim.Refetch()
DataGrid1.DataBind()
Thanks,
Carlo.