codesmithtools / Templates

CodeSmith Generator Templates
http://www.codesmithtools.com/product/generator
54 stars 35 forks source link

Missing braces at end of LastChanged System.Byte(8) (VB) #388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Generate CSLA template

What is the expected output? 
Friend LastChanged As System.Byte() = New System.Byte(8) {}

What do you see instead?
Friend LastChanged As System.Byte() = New System.Byte(8)

What version of the product are you using?

CodeSmith: v5.2.1, CSLA Templates: v2.0.1.1666, CSLA Framework: v4.0.0.
Visual Studio 2010

Original issue reported on code.google.com by bill.n...@gmail.com on 7 Jun 2010 at 4:46

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 10 Jun 2010 at 2:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
OK, more checking.  I added the {} at the end of the statement and VS2010 
seemed to think it was OK.  Every time I build it, though, the {}'s are removed 
and the build fails.

So my statement about what is wrong is not right, either. :)

Another approach is probably necessary (and I don't know what that is, yet).

I noticed in Rocky's code, he usually initializes this to Nothing or a 
System.Linq.Binary type equal to nothing (I think).

Actually I haven't done any research on how to achieve what the original intent 
was and haven't tested just setting it to Nothing, either.

Perhaps I can test some of it this weekend.

Original comment by bill.n...@gmail.com on 11 Jun 2010 at 1:33

GoogleCodeExporter commented 9 years ago
OK, found what we need to change, but I'm not sure how to do it.

In the Properties.CST file, the line currently reads:
Friend <%= Entity.RowVersionMember.PropertyName %> As <%= 
Entity.RowVersionMember.SystemType %> = New <%= 
Entity.RowVersionMember.SystemTypeWithSize %>

I believe it should read:
Friend <%= Entity.RowVersionMember.PropertyName %>(<%= 
Entity.RowVersionMember.Size %>) As<%-- <%= 
Entity.RowVersionMember.BaseSystemType %>s --%>

However, that yields this result:
    Friend LastChanged(8) As System.Byte(

Yes, that's a stray paranthesis on the end.

If I update the template and force it to a "System.Byte" literatl, it works OK.

HTH

v 1689, VS2010, .NET v4, CSLA v4

Original comment by bill.n...@gmail.com on 13 Jun 2010 at 8:59

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in revision 1695.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 14 Jun 2010 at 9:36

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 21 Jun 2010 at 8:08