Some questions (Calculated Fields, DISTINCT )

Posts   
 
    
Xeo
User
Posts: 2
Joined: 16-Aug-2010
# Posted on: 16-Aug-2010 11:20:32   

I'm using your product for evaluation purposes in order to find a good OR-mapping tool for my boss.

I have searched the forums for some time but I could not find an answer to some of my questions:

  • How can I use LLBLGen Pro to use calculated fields in its query's. So for example a query in which I can perform a WHERE-clause which does something like this: (database_field * 42 + other_database_field * 84 == some_value).

  • How can I perform a DISTINCT query? I only found a solution to use views in which you could filter the data. But this is no real solution because this would result in to large amounts of data being send between the client and the database.

I'm using the latest trial version of your product (3.0 Final - TRIAL), with dot.net 2.0. Furthermore I'm using the adapter-template.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 16-Aug-2010 17:18:50   
  • How can I use LLBLGen Pro to use calculated fields in its query's. So for example a query in which I can perform a WHERE-clause which does something like this: (database_field * 42 + other_database_field * 84 == some_value).

Please check Expressions In Predicates

  • How can I perform a DISTINCT query? I only found a solution to use views in which you could filter the data. But this is no real solution because this would result in to large amounts of data being send between the client and the database.

All entityCollections are fetched with Distinct applied. If you are fetching a DynamicList or a TypedView, you'll have to pass false for the AllowDuplicate parameter available in an of the fetch method's overloads.

Xeo
User
Posts: 2
Joined: 16-Aug-2010
# Posted on: 17-Aug-2010 11:15:12   

Oh damn should have looked at that.. Sorry!

Thnx for the quick reply!