CodeSmith Community
Your Code. Your Way. Faster!

Patch for EntityKey : EntityKeyBase

rated by 0 users
This post has 1 Reply | 0 Followers

Not Ranked
Posts 7
Points 275
Lampous Posted: 04-04-2007 7:36 PM

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>


 

Top 10 Contributor
Posts 925
Points 35,460

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