How to serialize third party vendor classes so that I can send them to CSLA server side? #2268
Replies: 3 comments 1 reply
-
I think your wrapper is the right idea (if you can't alter the Telerik code itself). But your wrapper's Get/Set state methods need to put primitive types into the serialization stream, you can't put complex types into the stream. The |
Beta Was this translation helpful? Give feedback.
-
@rockfordlhotka - I have spent all day creating CSLA compatible wrappers to wrap the third party Telerik class into. I've now just realized that the Telerik class has a couple of properties of type Is there any way that I could serialize these types - maybe using JSON.NET to serialize to a string and pass the entire class as a string and then use JSON.NET to de-serialize it on the CSLA DataPortal side? Or should I abandon the whole idea of passing this class to the CSLA DataPortal, wrapped or not? |
Beta Was this translation helpful? Give feedback.
-
I've run into this kind of obstacle several times, although not in the Blazor context. We use a ReadOnly stereotype to act as a DTO and ferry the simple properties we really need from client to server. The Telerik class would be passed in the constructor, but not as a field within the class. The server-side code can use the properties on the ReadOnly class instead of referencing the Telerik third-party class. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using Telerik Blazor UI components in a Blazor WebAssembly project and specifically the Telerik Grid.
Telerik supply a
DataSourceRequest
class and associated extension methods that work with thisDataSourceRequest
class object which contains all the required information from the grid instance about the current page number, how many records per page, any column filters or column groups applied.I want to be able to send this object to the DataPortal_Fetch method so that I can use it in my data retrieval query.
At the moment when I pass it in I get the following error message:
Serialization of type object is not supported. (Telerik.DataSource.DataSourceRequest)
The Telerik class looks like this:
I have tried to create a Wrapper class and have the
Telerik.DataSource.DataSourceRequest
object as a property on the wrapper and manually serialize/deserialized the property - this hasn't worked either, e.g:Beta Was this translation helpful? Give feedback.
All reactions