QueryFactory / DynamicQuery

Posts   
 
    
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 17-May-2013 10:58:25   

Hi guys,

I am new to the QueryFactory. I´ve examine your samples but I didn´t found the answer to the following requirement using "SelfServicing-Scenario":


            var qf = new QueryFactory();

            var q = qf.FBV
                .From(QueryTarget.InnerJoin(qf.Bank).On(BankFields.BLZ == FBVFields.BLZ & BankFields.BLZF == 1))
                .Select(() => new
                {
                    Konto = FBVFields.KONTO.As("Konto2").ToValue<decimal>(),
                    Blz = BankFields.BLZ.As("Blz2").ToValue<decimal>(),
                    Name = BankFields.NAME.As("Name2").ToValue<string>(),
                    Bankverbindung = new FBVEntity()
                    {
                        BANK = FBVFields.BANK.ToValue<string>(),
                        BIC = FBVFields.BIC.ToValue<string>(),
                        BLZ = FBVFields.BLZ.ToValue<decimal>(),
                        FNR = FBVFields.FNR.ToValue<decimal>(),
                        IBAN = FBVFields.IBAN.ToValue<string>(),
                        ID = FBVFields.ID.ToValue<decimal>(),
                        JAHR = FBVFields.JAHR.ToValue<decimal>(),
                        KONTO = FBVFields.KONTO.ToValue<decimal>(),
                        LFD = FBVFields.LFD.ToValue<decimal>()
                    }
                });


Instead of making a copy of the FBVEntity I want a projection of the joined entity. Something like that:


            var q = qf.FBV
                .From(QueryTarget.InnerJoin(qf.Bank).On(BankFields.BLZ == FBVFields.BLZ & BankFields.BLZF == 1))
                .Select(() => new
                {
                    Bank = ? (BankEntity),
                    Bankverbindung = ? (FBVEntity)
                });

Any suggestions?

Please see signature for Version Information at the bottom.

Regards Carlo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 17-May-2013 14:33:50   

Queryspec doesn't support that scenario (it's focused on queries, not entities). If you want that particular projection, please use Linq, which does support that scenario.

Frans Bouma | Lead developer LLBLGen Pro
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 17-May-2013 18:09:58   

Thank you.