Need help with CslaContrib template VB CodeSmith 2.0

Need help with CslaContrib template VB CodeSmith 2.0

Old forum URL: forums.lhotka.net/forums/t/5946.aspx


reagan123 posted on Friday, December 05, 2008

Hello Everyone.

I'm new to the templates and i'm trying to generate a ReadOnlyRootList.  My list object is called JobInfoList.  I've tried creating my JobInfo class from both ReadOnlyChild and ReadOnlyRoot and can't get either to work.  When I use ReadOnlyChild it gets to the following method in the JobInfoBase class and fails

        Friend Shared Function GetJobInfo(ByVal dr As SafeDataReader) As T
            Dim child As T = DataPortal.Create(Of T)()
            child.Fetch(dr)
            Return child
        End Function

"Csla.DataPortalException: DataPortalFetch failed(System.ArgumentNullException: Value cannot be null. Paramerter name: element"

If I use ReadOnlyRoot I get a compiler issue on this line in my JobInfoBase class.

  Me.Add(JobInfoBase(Of C).GetJobInfo(dr))

Can someone help me out to find out what I'm doing wrong?

Thanks!

CodeSmith 2.6
CSLA 2.0 VB Templates from CSLA Contrib
VisualStudio 2005
SplitBase Generation

 

reagan123 replied on Monday, December 08, 2008

Nevermind... I got it.  I had to change the signature of my DataPortal_Create from

Private Sub DataPortal_Create(ByVal criteria As Object)

to

Private Sub DataPortal_Create()

Copyright (c) Marimer LLC