CodeSmith Templates for CSLA - VB and C#

CodeSmith Templates for CSLA - VB and C#

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


figuerres posted on Tuesday, August 22, 2006

Hi all,

I have seen a few comments about the CodeSmith Templates for VB not being complete / correct and wanted to know more....

I've done VB for years and C for a long time and a lot of C# in the last year.

I kinda want to do a new project in VB with the CodeSmith templates but the idea of having to deal with bad gen'ed code is not one I like....

I see the code moved from GDN to CodePlex and the bug track there is very small.

can anyone comment on this?

I might be able to help with the VB temaplates but I'd like to know more before I dive in to them --

Thanks!

Skafa replied on Tuesday, August 22, 2006

I use the C# templates on a regular basis, found a couple of small bugs, reported them and got fixed in no-time.

Don't know about the VB templates though.

david.wendelken replied on Tuesday, August 22, 2006

I'm just starting to use the C# ones at home, and they seem plausibly correct.

Most of the issues I've seen on this forum have appeared to be either:

The second issue is a problem newbies to the architecture have even when using the hand-coded templates Rocky provides

 

JoeFallon1 replied on Tuesday, August 22, 2006

According to Ricky, the VB templates are now up to speed in 2.0:

"C# templates for Csla 2.0 are a complete rewrite to handle many kinds of data source.  Imo, they are much better and more stable than the 1.x version.  Allan Nielsen has converted these templates to vb version.  If you haven't already try it, please check them out at CslaContrib.

Ricky"

I downloaded the set and took a quick look. They look excellent. Allan has done a great job keeping them in synch with the C# templates. So if you want to use the new 2.0 VB templates you should be fine. The 1.x templates are still suspect in my opinion.

Joe

 

figuerres replied on Tuesday, August 22, 2006

thanks for the feedback everyone!

 

this is the best work I have had in a while :-)

for me learning new stuff is "fun work"

if the trend with CSLA and CodeSmith keeps going I think I will have the tools to really crank out some apps!

just need to get a few steps further....

I might just post some stuff for sql proc generation after I get the hang of CodeSmith and what I need to hook into CSLA.

 

TerryHolland replied on Tuesday, December 12, 2006

I am exploring the vb templates and notice that, as well as being able to select a 'Root Table' as the source for my class, I can also select a 'Root View' or a 'Root Command'.  Ive been truing to experiment with the view and command options without much success. 

I have the following scenario

tblTest is a table containing ID(PK), Forename, Surname, DoB

vieTest has the following sql: Select ID, Forename from tblTest order by Forename

sprTest is essentioall the same as the vieTest

 

What I find is that if I use Root View, and I select vieTest as my Root View and enter ID as my Unique Column, the template runs but I notice that that the ExecuteFetch procedure is as follows

==========================

 Private Sub ExecuteFetch(ByVal cn As SqlConnection, ByVal criteria As Criteria)
  Using cm As SqlCommand = cn.CreateCommand()
   cm.CommandType = CommandType.StoredProcedure
   cm.CommandText = "GetCustomerOrder_Display"
   cm.Parameters.AddWithValue("@ID", criteria.Id)

   Using dr As SafeDataReader = New SafeDataReader(cm.ExecuteReader())
    FetchObject(dr)

    'load child object(s)
    FetchChildren(dr)
   End Using
  End Using
 End Sub

=========================

This is trying to execute a procedure so should I be generating a procedure similar to select * from vieTest?

 

When I try to use Root Command,  I cant get the template to generate anything as I get an error saying that Unique Column is Required even though I have entered ID into this column

 

Please advise

David replied on Thursday, August 24, 2006

Actually I'm having some problems trying to get the VB templates working with partial classes and I'de love to know how to sort it out. I have tried posting on the codeplex site but there are no responses to any of the issues raised there. Where is the most appropriate place to discuss these issues?

By the way, I think the templates are awesome and really appreciate the work done by all the contributers!!

 

David

 

Copyright (c) Marimer LLC