Deserialize CompositeFilterDescriptor

1 Answer 49 Views
Filter
John
Top achievements
Rank 1
Iron
John asked on 11 Jul 2022, 04:58 PM

I'm trying to save the CompositeFilterDescriptor.

If I do the following:

var serializedFilter = JsonSerializer.Serialize(FilterValue);
var deserializedFilter = JsonSerializer.Deserialize<CompositeFilterDescriptor>(serializedFilter);

The deserializedFilter FilterDescriptor.MemberType is null and if used causes the the display of the filters to throw an exception.

Note that the filters are part of a user preferences class that is serialized as a whole. So is there a proper way to serialize/deserialize?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 14 Jul 2022, 05:54 AM

Hi John,

MemberType is a Type and falls under a known limitation. You can either populate the MemberTypes manually after deserialization, or implement some more elaborate workaround that will automate the process for you.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Filter
Asked by
John
Top achievements
Rank 1
Iron
Answers by
Dimo
Telerik team
Share this question
or