in

CodeSmith Community

Your Code. Your Way. Faster!

A Table with a Column Named Value Results in a Warning Message

Last post 02-13-2008 12:27 AM by ChuckB. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-12-2007 11:11 AM

    Crying [:'(] A Table with a Column Named Value Results in a Warning Message

    I have a table with a column named Value.

     

    The NetTiers generated code for set/get results in a bug.

    if (value == value)
    {  return value; }
    else
    {
        this.value = value;
        return value;
    }

    Should be:

    if (value == this.Value)
    {  return value; }
    else
    {
        this.value = value;
        return value;
    }

     

    Ben Taylor - Database Architect
    Clearent, LLC - www.clearent.com
    ben@clearent.Com
    • Post Points: 35
  • 02-13-2008 12:27 AM In reply to

    • ChuckB
    • Not Ranked
    • Joined on 12-21-2007
    • Posts 2
    • Points 10

    Re: A Table with a Column Named Value Results in a Warning Message

    This can be fixed in the Entities\Views\EntityViewBase.generated.cst file, on lines 152 and 156.

     

    Line 152 looks like:

    if (<%= GetFieldName(SourceView.Columns[x]) %> == value && <%=GetPropertyName(SourceView.Columns[x])%> != null )

    Change it to:

    if (this.<%= GetFieldName(SourceView.Columns[x]) %> == value && this.<%=GetPropertyName(SourceView.Columns[x])%> != null )

     

    Similarly, line 156 looks like:

    if (<%= GetFieldName(SourceView.Columns[x]) %> == value)

    Change it to:

    if (this.<%= GetFieldName(SourceView.Columns[x]) %> == value)

     

    This would be a good change to make to the official template, IMHO.  With XProp approaches, "value" is a natural and common column name.

     

    • Post Points: 5
Page 1 of 1 (2 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems