CodeSmith Community
Your Code. Your Way. Faster!

Entities Conflict with table named Match

Latest post 02-15-2007 12:15 PM by bgjohnso. 2 replies.
  • 02-13-2007 10:52 AM

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

    Entities Conflict with table named Match

    I had a table in my DB called "Match" and there is an object Match in the Entities/EntityUtil.cst template that is supposed to be System.Text.RegularExpressions.Match but since the namespace includes the name from the table the compiler was getting confused.  I created a patch that explicitly declares the correct type. It is a small but useful patch.

     

    Index: Entities/EntityUtil.cst
    ===================================================================
    --- Entities/EntityUtil.cst    (revision 484)
    +++ Entities/EntityUtil.cst    (working copy)
    @@ -836,7 +836,7 @@
                     "^({|\\()?[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}(}|\\))?$|" +
                     "^({)?[0xA-Fa-f0-9]{3,10}(, {0,1}[0xA-Fa-f0-9]{3,6}){2}, {0,1}({)([0xA-Fa-f0-9]{3,4}, {0,1}){7}[0xA-Fa-f0-9]{3,4}(}})$");
                
    -            Match match = format.Match(s);
    +            System.Text.RegularExpressions.Match match = format.Match(s);
                
                 if ( match.Success )
                 {


     

    Filed under:
    • Post Points: 65
  • 02-14-2007 10:42 PM In reply to

    • MrBretticus
    • Top 75 Contributor
    • Joined on 02-10-2006
    • Perth, Australia
    • Posts 54
    • Points 1,360

    Re: Entities Conflict with table named Match

    You will need to use the aliases or mapping files (depending on which revision of .netTiers you are working with) to rename the generated entity.
    Cheers, Brett "Most human beings have an almost infinite capacity for taking things for granted." - Aldous Huxley
    • Post Points: 5
  • 02-15-2007 12:15 PM In reply to

    • bgjohnso
    • Top 10 Contributor
    • Joined on 09-15-2005
    • Spokane, WA
    • Posts 764
    • Points 22,530

    Re: Entities Conflict with table named Match

    Lampous,

    I went ahead and fixed this by aliasing the System.Text.RegularExpressions namespace and fully-qualifying both Match and RegEx.

    Thanks for contribution.  Committed as SVN 488.

    Ben Johnson
    ------------------------------
     Member of the .NetTiers team
     Visit http://www.nettiers.com
    ------------------------------

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