CodeSmith Community
Your Code. Your Way. Faster!

Collections?

Latest post 05-23-2007 2:49 PM by ToddMoon. 4 replies.
  • 05-23-2007 10:51 AM

    • ToddMoon
    • Top 100 Contributor
    • Joined on 05-22-2007
    • Rochester, NY
    • Posts 44
    • Points 840

    Collections?

    I've seen in example of DeepLoad in this forum that used code like this:

    DataRepository.EmployeesProvider.DeepLoad(emp,true,DeepLoadType.IncludeChildren, new Type[] {typeof(OrdersCollection),typeof(OrderDetailsCollection)});
     

    Notice the OrdersCollection. I don't have any such types in my output. Any list of related records is always a generic TList<>. I notice that the template has a CollectionFormat property that makes me think it might generate an OrdersCollection in some scenario.

    So instead, when I do a DeepLoad, I just use typeof( TList<Orders> ) and it seems to work fine.

    Are these custom collections an old feature that has been removed? Or might it need to be enabled in some way?
     

    Filed under: ,
    • Post Points: 35
  • 05-23-2007 1:46 PM In reply to

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

    Re: Collections?

    You should carry on using the TList as you currently do.  I think the xxCollection was an old feature of v1.

    hth

    swin

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 05-23-2007 1:54 PM In reply to

    • ToddMoon
    • Top 100 Contributor
    • Joined on 05-22-2007
    • Rochester, NY
    • Posts 44
    • Points 840

    Re: Collections?

    swin:

    You should carry on using the TList as you currently do.  I think the xxCollection was an old feature of v1.

    Ok, thanks. The CollectionFormat property on the template should probably be removed then.

    I also see that there is a property for AliasFilePath, but now netTiers has a complete mapping file. Does the AliasFile still work in addition to the mapping file?
     

    • Post Points: 35
  • 05-23-2007 2:46 PM In reply to

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

    Re: Collections?

    The collection format is used to name a TList collection where you have 1:M relationships. i.e. in an Order entity you might have:

    TList<OrderDetails> OrderDetailsCollection

    The mapping/alias file is currently being worked on and there will be a new property to allow selection of either.  Generally speaking though you should go with the mapping file as that is a more flexible solution and more likely to be enhanced in the future. 

    hth

    swin

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 05-23-2007 2:49 PM In reply to

    • ToddMoon
    • Top 100 Contributor
    • Joined on 05-22-2007
    • Rochester, NY
    • Posts 44
    • Points 840

    Re: Collections?

    Oh, I see. I did notice that the property created was named as EntityCollection. I thought that might have been a coincidence though. :)
    • Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems