CodeSmith Community
Your Code. Your Way. Faster!

The name <name> does not exist in the current context?

Latest post 11-22-2006 9:02 AM by Robert Hinojosa. 3 replies.
  • 11-14-2006 11:20 AM

    • tcwm
    • Not Ranked
    • Joined on 05-23-2006
    • Posts 4
    • Points 80

    The name <name> does not exist in the current context?

    I get 48 errors as stated in the subject.

    But I do not understand why it happens or how to resolve the issue.

    Below you can see defined properties  SECONDEARNID and THIRDEARNID

    SECONDEARNID did not get the SECONDEARIDsource =null assignment from the generation.

    THIRDEARNID did get a THIRDEARNIDsource = null  assignment. Why?

    It is the <NAME>source=null; line that generates all the errors.

    Can ayone provide clarity and help?

    tia,
    Todd 

    <CODE>

    /// <summary>

    /// Gets or Sets the SECONDEARNID property.

    ///

    /// </summary>

    /// <value>This type is varchar</value>

    [Entities.Bindable,

    DataObjectField(false, false, true, 15)]

    public override System.String SECONDEARNID

    {

    get

    {

    return base.SECONDEARNID;

    }

    set

    {

    if (base.SECONDEARNID == value)

    return;

     

    base.SECONDEARNID = value;

    SECONDEARNIDSource = null;

    }

    }

    /// <summary>

    /// Gets or Sets the THIRDEARNID property.

    ///

    /// </summary>

    /// <value>This type is varchar</value>

    [Entities.Bindable,

    DataObjectField(false, false, true, 15)]

    public override System.String THIRDEARNID

    {

    get

    {

    return base.THIRDEARNID;

    }

    set

    {

    if (base.THIRDEARNID == value)

    return;

     

    base.THIRDEARNID = value;

    THIRDEARNIDSource = null;

    }

    }

    </CODE>

    • Post Points: 5
  • 11-14-2006 11:26 AM In reply to

    • tcwm
    • Not Ranked
    • Joined on 05-23-2006
    • Posts 4
    • Points 80

    Re: The name <name> does not exist in the current context?

    Sorry...

    Wrong problem description.

    SECONDEARNIDsource gets the null assignment but does not generate an error but THIRDEARNIDsource does.

    What context? Why the difference? Why even generate the <NAME>source=null;?

    tia,

    Todd

    • Post Points: 35
  • 11-21-2006 10:27 PM In reply to

    • wala
    • Not Ranked
    • Joined on 11-22-2006
    • Posts 1
    • Points 35

    Re: The name <name> does not exist in the current context?

    I'm also encountering the same issue with *.Generated.cs in generated DomainModel project. The Components\ComponentBase.cst is used to generate:

       set
       {
        if (base.<%= GetPropertyName(cols[x].Name) %> == value)
         return;
         
        base.<%= GetPropertyName(cols[x].Name) %> = value;
        <% if (IncludeGetListByFK && cols[x].IsForeignKeyMember) {
         foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
         {
          if (!SourceTables.Contains(tableKey.PrimaryKeyTable))
           continue;
        %>
        <%= GetPropertyName(cols[x].Name)%>Source = null;
        <%  }// end foreach
        } //end if
        %>
       }

    And here is the result:

       set
       {
        if (base.DocNo == value)
         return;
         
        base.DocNo = value;
        DocNoSource = null;
       }

    I have also tried nightly build and got the same result.

    • Post Points: 35
  • 11-22-2006 9:02 AM In reply to

    Re: The name <name> does not exist in the current context?

    I believe this issue has to deal with you having foreign keys to this table, but they are not being selected as tables to be generated.  We will re-investigate this problem and try to issue a fix soon.  Can you confiirm that DocNo is a column on that table that is a foreign key to another table, which is *not* selected for generation, or was skipped because it doesn't have a primary key?

    Robert

    On 11/21/06, wala <bounce-wala@codesmithsupport.com> wrote:

    I'm also encountering the same issue with *.Generated.cs in generated DomainModel project. The Components\ComponentBase.cst is used to generate:

       set
       {
        if (base.<%= GetPropertyName(cols[x].Name) %> == value)
         return;
         
        base.<%= GetPropertyName(cols[x].Name) %> = value;
        <% if (IncludeGetListByFK && cols[x].IsForeignKeyMember) {
         foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
         {
          if (!SourceTables.Contains(tableKey.PrimaryKeyTable))
           continue;
        %>
        <%= GetPropertyName(cols[x].Name)%>Source = null;
        <%  }// end foreach
        } //end if
        %>
       }

    And here is the result:

       set
       {
        if (base.DocNo == value)
         return;
         
        base.DocNo = value;
        DocNoSource = null;
       }

    I have also tried nightly build and got the same result.






    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems