CodeSmith Community
Your Code. Your Way. Faster!

Patch for EntityKey : EntityKeyBase

Latest post 04-30-2007 7:01 AM by swin. 1 replies.
  • 04-04-2007 7:36 PM

    • Lampous
    • Not Ranked
    • Joined on 12-08-2006
    • Posts 7
    • Points 275

    Patch for EntityKey : EntityKeyBase

    Where you have a table with another table with the same name with "Key" on the end conflicts arise.

    I have a table called Application and I wanted to store the results of the app in a key value form, hence I created ApplicationKey and ApplicationValue.

    Unfortunately, my table named "ApplicationKey" conflicts with the EntityKey class from the Application table and so I was getting:

    Error    1    Missing partial modifier on declaration of type 'Entities.ApplicationKey'; another partial declaration of this type exists    C:\...\Entities\ApplicationBase.generated.cs    1445    15  

     

    Thus, I created a patch that changes the name of EntityKey class from EntityKey : EntityKeyBase to EntityEntityKey. Now I get Application with ApplicationEntityKey : EntityKeyBase and also ApplicationKey and ApplicationKeyEntityKey : EntityKeyBase.  The patch is pasted below.

     

    Index: CommonSqlCode.cs
    ===================================================================
    --- CommonSqlCode.cs    (revision 535)
    +++ CommonSqlCode.cs    (working copy)
    @@ -559,7 +559,7 @@
             /// </summary>
             public string GetKeyClassName(string tableName)
             {
    -            return String.Format("{0}Key", GetClassName(tableName));
    +            return String.Format("{0}EntityKey", GetClassName(tableName));
             }
     
             /// <summary>


     

    Filed under:
    • Post Points: 35
  • 04-30-2007 7:01 AM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 924
    • Points 34,750

    Re: Patch for EntityKey : EntityKeyBase

    Enhanced and added as new property EntityKeyFormat in SVN549.

    Thanks

    swin 

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