This is a migrated thread and some comments may be shown as answers.
Dynamic Predicates?
1 Answer 39 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
k f
Top achievements
Rank 1
k f asked on 18 Nov 2008, 03:31 PM
Does the OA ORM being offered by Telerik provide for a way to generic dynamic predicates as criteria for returning data?

Linq to Sql allows for this in utilizing expression trees.  LLBL Gen which I currently use has predicate options which can be used with Relations.

An example of what I'm referring too.  Take the Northwind DB.  I want to create a GetEmployees endpoint.  The parameters that I may allow a consumer to pass in would be EmployeeId, First Name, Last Name, DOB, HireDate.

My method logic would check to see if which of these are passed in and the ones that have a value will be used to build a predicate to filter the records being returned from the database.

Does this OA ORM allow for such functionality?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 19 Nov 2008, 03:12 PM
Yes, OpenAccess allows this by using OQL string fragments and concatenating them as needed. You might also want to have a look at 'Dynamic LINQ' from this blog when you want to use LINQ.

Kind regards,
Thomas
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
k f
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or