Unable to Parse a CompositeFilterDescriptor Object generated by a Filter Component on the Server side

0 Answers 72 Views
Filter
Ahmed
Top achievements
Rank 1
Ahmed asked on 04 Sep 2023, 01:20 PM

Hi there,

While working with the Filter Component I was able to export an CompositeFilterDescriptor object on the client side before sending it to the server, the backend is a .net core API.

Unfortunately I tried to use Telerik.Datasource DLL in order to utilize the JSON parsing functionality inside however it seems like they are from two different worlds !

On the Angular side the CompositeFilterDescriptor looks like this 

{
    "logic": "or", 
    "filters": [ 
       {
           "field" : "unitId",
           "operator" : "eq", 
            "value" : "1005"
       }
     ]
}


On the .NET side the CompositeFilterDescriptor it is expecting something like this 

{
  "logicalOperator": 1,
  "filterDescriptors": [
      {
        "member": "unitId", 
        "operator": 2 , 
        "value" : "1005"
      }
  ]
}

 

Summary of Differences

1- Field names are different and hence not parsed properly ( i.e. logicalOperator vs logic)

2- Enumerations are sent as strings from Angular but parsed as Integers from Telerik.Datasource 

3- Its called Field in Angular and Member in Telerik.Datasource

 

I feel a little bit confused here, is there any library provided by telerik that I can use to capture the Angular CompositeFilterDescriptor received from the client app inside a Web API ?

 

 

No answers yet. Maybe you can help?

Tags
Filter
Asked by
Ahmed
Top achievements
Rank 1
Share this question
or