Dynamic Predicates?

Thread is closed for posting
2 posts, 0 answers
  1. k f
    k f avatar
    109 posts
    Member since:
    Jun 2006

    Posted 18 Nov 2008 Link to this post

    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.
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 19 Nov 2008 Link to this post

    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.
Back to Top