CodeSmith Community
Your Code. Your Way. Faster!

DeepSave foreign key bug in EntityProviderBaseCore.generated.cst?

Latest post 01-21-2008 5:22 PM by barker_djb. 0 replies.
  • 01-21-2008 5:22 PM

    • barker_djb
    • Not Ranked
    • Joined on 06-20-2007
    • Bellevue, WA
    • Posts 7
    • Points 95

    DeepSave foreign key bug in EntityProviderBaseCore.generated.cst?

    I'm fairly new to .NetTiers, but think I've found an issue here. 

    I found that when I create an entity, and then create a dependent object within that entity, and use DeepSave, it is not using the full shared key of a composite key, but only a single field.

    I think perhaps this section of code is doing something different than the intent: 

    for(int j = 0; j < item.TableKey.ForeignKeyMemberColumns.Count; j++)
    {
        string fkPropertyName = GetKeysName(item.TableKey.ForeignKeyMemberColumns);
        string currProp = GetPropertyName(item.TableKey.ForeignKeyMemberColumns[j]);

        if(filled.Contains(fkPropertyName ))
            continue;
        
        filled.Add(fkPropertyName);

    What I'm seeing is that thie fkPropertName doesn't change on multiple iterations, so you only go through this loop once.

    However, if currProp, which looks like individual fields, is used instead, that works better:

    for(int j = 0; j < item.TableKey.ForeignKeyMemberColumns.Count; j++)
    {
        string fkPropertyName = GetKeysName(item.TableKey.ForeignKeyMemberColumns);
        string currProp = GetPropertyName(item.TableKey.ForeignKeyMemberColumns[j]);
        if(filled.Contains(currProp))
            continue;
        
        filled.Add(currProp);

    Can anyone comment--am I confused?  Is there a better way to submit a possible fix such as this?

    Thanks,

    Dwight Barker

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