I'm working on a mod to the CSLA templates to work better with parent/child relationships. I'm trying to connect them together using the Tags - but I'm running into some access problems.
I have a tag for a parent object that defines a comma seperated list of child entities. I'm using the following code to do this:
Protected ChildNameList As New List(Of String)
Protected ChildEntityList As New List(Of CodeBreeze.Business.BusinessEntity)
...
If _Entity.Tags("Child").Value <> "" Then
Dim childSeparators() As Char = {","c, " "c}
Dim childSplit As String() = _Entity.Tags("Child").Value.Split(childSeparators)
For Each child As String In childSplit
If child <> "" Then
ChildNameList.Add(child)
ChildEntityList.Add(_Project.BusinessEntities.FindByEntity(child))
End If
Next child
End If
This appears to work fine. Iterating ChildNameList is fine, and it appears that iterating ChildEntityList is as well, until you try to reference something like
ChildEntityList(0).EntityName, then it gives an "Error(s) in code template. ..."
Any ideas what might be wrong.