in

Community

Take part in the community surrounding CodeBreeze and other products from SteelBlue Solutions.
Latest post 02-22-2010 4:10 PM by Joseph Baggett. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-08-2010 4:57 PM

    Issues accessing _Project.BusinessEntities

    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.

  • 02-08-2010 4:59 PM In reply to

    Re: Issues accessing _Project.BusinessEntities

    Wow - sorry about the formating on this post - it was cut/paste code thta looked fine in the editor!

  • 02-08-2010 5:08 PM In reply to

    Re: Issues accessing _Project.BusinessEntities

    Nevermind, I had a spelling error in one of my entity names.

  • 02-22-2010 4:10 PM In reply to

    Re: Issues accessing _Project.BusinessEntities

    Yep, when it finds the entity by a string name, it will blow up b/c it does not exist.  Good find. :P

Page 1 of 1 (4 items)
2008 - All rights reserved
Powered by Community Server (Commercial Edition), by Telligent Systems