CodeSmith Community
Your Code. Your Way. Faster!

DeepLoad question

Latest post 11-24-2006 8:30 AM by mike123. 1 replies.
  • 11-23-2006 7:16 PM

    DeepLoad question

    I have 2 tables T1 and T2.

     

    T1(users table)
    userid
    name
    address

     
    T2(invoice table)
    invoiceid
    amount
    useridwhoregister
    useridwhoupdate

                 T2Service _t2service = new T2Service();
                T2 _t2 = _t2service.DeepLoadByInvoiceId(Convert.ToInt32(Request.Params["id"]), true, DeepLoadType.IncludeChildren, typeof(T1), typeof(T1));

    Which would be the syntax for this DeepLoad process? I need to have useridwhoregistersource.userid   and useridwhoupdatesource.userid. Or which is the syntax if I need just one of them?

     

    Thanks 


     

    Filed under:
    • Post Points: 35
  • 11-24-2006 8:30 AM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 735
    • Points 17,045

    Re: DeepLoad question

    benitolopez,

    You're on the right track ... specify your user table type only once, and also make sure you set relationships between the two tables

                T2Service _t2service = new T2Service();
                T2 _t2 = _t2service.DeepLoadByInvoiceId(Convert.ToInt32(Request.Params["id"]), true, DeepLoadType.IncludeChildren, typeof(T1));
                Console.WriteLine(_t2.useridwhoregistersource.username);
                Console.WriteLine(_t2.useridwhoupdatesource.username);

    Hope that helps

    benitolopez:

    I have 2 tables T1 and T2.

     

    T1(users table)
    userid
    name
    address

     
    T2(invoice table)
    invoiceid
    amount
    useridwhoregister
    useridwhoupdate

                 T2Service _t2service = new T2Service();
                T2 _t2 = _t2service.DeepLoadByInvoiceId(Convert.ToInt32(Request.Params["id"]), true, DeepLoadType.IncludeChildren, typeof(T1), typeof(T1));

    Which would be the syntax for this DeepLoad process? I need to have useridwhoregistersource.userid   and useridwhoupdatesource.userid. Or which is the syntax if I need just one of them?

     

    Thanks 


     

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

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