Skip to content

Dynamic OData Parsing #1

@MgSam

Description

@MgSam

I'd like to use your great library to parse an OData expression, however from what I can tell it doesn't currently support the type of dynamic situation I'm looking at.

Essentially, I can't call ODataFilterLanguage.Parse because there is no type to parse into known at compile time. Essentially, I need to be able to pass a dictionary of names/types in and have it create an expression that will check either a dictionary of values or just check values based on their ordinal position in an array.

Background- I have a data grid whose columns are unknown at compile time (it gets bound to a DataTable at runtime). I then have a search box where I want the user to be able to type OData filters. I need to compile these filters and check them against the ItemArray of each row in the table.

An existing option is to dynamically create a type with properties for each column in the data table, use that in the Parse method, and then use the resulting expression to filter against each DataRow with its items first populating instances of the dynamic type. However, this solution isn't ideal because it would involve a lot of extra copying data around just to work with the existing API.

Please let me know if this situation makes sense or if there's a way to accomplish what I'm looking to do with the existing API. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions