Hello I want to delete the assignments to PersonInOrg. Unfortunately that doesn't work and I don't get a meaningful error. Do I have to do a deep delete?
'Remove all Assigments to all Project Rolls for the user
'==================================================
'Loop throu all sub Project Rols
For Each colbRoleElement As IEntity In colbRole
Dim colbeAssigments As IEntityCollection
Dim fRoleAssigments As ISqlFormatter = Session.SqlFormatter
'Query is there an Assigments to Role and Userid
Dim qRoleAssigments = Query.From("PersonInORG") _
.Where(fRoleAssigments.AndRelation(fRoleAssigments.Comparison("UID_ORG", colbRoleElement.GetValue("UID_Org").String, ValType.String, CompareOperator.Equal),fRoleAssigments.Comparison("UID_Person", userUid, ValType.String, CompareOperator.Equal))) _
.Select("UID_Person", "UID_Org")
colbeAssigments = Session.Source.GetCollection(qRoleAssigments)
'If Query has Data
If( colbeAssigments.Count = 1)
Using uow = Session.StartUnitOfWork()
For Each assigment As IEntity In colbeAssigments
assigment.MarkForDeletion()
uow.Put(assigment)
Next
uow.Commit()
End Using
End If
Next