CodeSmith Community
Your Code. Your Way. Faster!

Aliases not taken into account!

Latest post 10-22-2007 2:02 PM by evali. 8 replies.
  • 01-17-2007 10:41 AM

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 189
    • Points 4,731

    Aliases not taken into account!

    Hi!

    I just regenerated my project with the latest version of .Nettiers (rev. 467, 2007-01-17), and the Alias File hasn't been taken into account. For example, I have the alias Clients:Client in that file, but Clients.cs has been generated in the entities instead of Client.cs.

    I tried various past revisions in order to be able to compile my code correctly, and I had to go back to revision 450. I did not try all of them between 450 and 467. Some of them gave me build errors in CodeSmith 3.2.7 (rev. 955).

    Cheers!

    JF 

    Filed under:
    • Post Points: 35
  • 01-18-2007 2:46 AM In reply to

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

    Re: Aliases not taken into account!

    I don't know why the Alias file isn't working anymore, but did you know there is now another way of doing this using a mapping file which is more flexible.

    See http://community.codesmithtools.com/forums/permalink/21511/21535/ShowThread.aspx#21535

    Maybe the introduction of the mapping file has broken the Alias file? 

    hth

    swin 

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 01-18-2007 11:41 PM In reply to

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

    Re: Aliases not taken into account!

    Yes I experienced this problem as well. I let .netTiers generate the mapping file automatically then modified it to match my original aliases file. Works fine, but it's something you need to be aware of before upgrading to the latest releases.

     

    Cheers, Brett "Most human beings have an almost infinite capacity for taking things for granted." - Aldous Huxley
    • Post Points: 35
  • 01-19-2007 6:34 PM In reply to

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 189
    • Points 4,731

    Re: Aliases not taken into account!

    Hi Brett and Swin!

    Ok, thanks for your answers! I can see where the .netTiers developers are going with this. It can become very handy in the future. Still, I hope they will fix the Alias file bug. It would be nice if the Alias file could be used to generate the Mapping file. Does anyone know what the various fields are/will be used for: FriendlyName, RelationshipType, IncludeInOutput, etc? Such a configuration file could be used to help generate a user interface that would be fully functional very rapidly and without needing that much tweaking.

    Cheers!

    JF
     

    • Post Points: 35
  • 01-22-2007 2:56 AM In reply to

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

    Re: Aliases not taken into account!

    I've found that if you still want to use your Alias file you can.  Just use an empty mapping file like the one attached and NetTiers will then use the alias file if specified.

    i.e.

    <?xml version="1.0" encoding="utf-8"?>
    <NetTiersMap xmlns="http://www.nettiers.com/NetTiersMap.xsd">
    </NetTiersMap>

    hth

    swin 

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    Filed under:
    • Post Points: 35
  • 07-25-2007 11:03 PM In reply to

    • mcgmatt
    • Not Ranked
    • Joined on 06-22-2007
    • Posts 6
    • Points 150

    Aliases and mapping not working in netTiers 2.2

    In netTiers 2.2 (2.2.0.603-20070725), neither the alias file nor the mapping file works.

    I tried the mapping file alone, the mapping file plus the alias file, an empty mapping file plus the alias file, and no mapping file (just path specified) plus the alias file.

    I can add "s" to the StrippedTableSuffixes to get it to work for Photos, but that method gives me a PhotoGallerie entity, so I'm still stuck.

    mapping.config

    <?xml version="1.0" encoding="utf-8"?>
    <NetTiersMap xmlns="http://www.nettiers.com/NetTiersMap.xsd">
     <Table Id="PhotoGalleries" EntityName="PhotoGallery" Owner="dbo" PropertyName="PhotoGallery" FieldName="photoGallery" FriendlyName="Photo Gallery" IncludeInOutput="true"/>
     <Table Id="Photos" EntityName="Photo" Owner="dbo" PropertyName="Photo" FieldName="photos" FriendlyName="Photo" IncludeInOutput="true"/>
    </NetTiersMap> 

    aliases.txt

    PhotoGalleries:PhotoGallery
    Photos:Photo

    • Post Points: 35
  • 07-26-2007 12:28 AM In reply to

    Re: Aliases and mapping not working in netTiers 2.2

    Hi, 

    Did you set the NameConversion property = Mapping, or Alias in the property grid?  It's under 02. Framework Generation.


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 65
  • 07-26-2007 8:46 AM In reply to

    • mcgmatt
    • Not Ranked
    • Joined on 06-22-2007
    • Posts 6
    • Points 150

    Re: Aliases and mapping not working in netTiers 2.2

    Aha... missed that one... should be in business now, thanks!

    • Post Points: 5
  • 10-22-2007 2:02 PM In reply to

    • evali
    • Top 500 Contributor
    • Joined on 12-15-2005
    • Posts 9
    • Points 135

    Re: Aliases and mapping not working in netTiers 2.2

    I did set the NameConversion property = Mapping as well as Alias and specified the mapping or alias file. I can not make it work. The geneated code did not pickup whatever in my mapping file.

    Any suggestions?

     

    Eva

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