Skip to content

Use registred CustomSerializer for Criteria-Objects#4866

Open
jensbrand wants to merge 2 commits into
MarimerLLC:mainfrom
jensbrand:dev/4865-customserializer-for-criterias
Open

Use registred CustomSerializer for Criteria-Objects#4866
jensbrand wants to merge 2 commits into
MarimerLLC:mainfrom
jensbrand:dev/4865-customserializer-for-criterias

Conversation

@jensbrand

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Criteria objects not inheriting from IMobileObject bypass registered custom serializers, causing serialization errors.
  • Solution: Refactored PrimitiveCriteria into a ReadOnlyBase and updated DataPortalProxy to instantiate it via the data portal.
  • Result: Criteria objects now serialize like standard properties and correctly utilize custom serializers.

Related Issue

Fixes #4865 (Custom Serializer for Criteria-Objects)

jensbrand added 2 commits June 3, 2026 15:34
…ated `DataPortalProxy` to use `IDataPortal<PrimitiveCriteria>` for criteria creation.

@StefanOssendorf StefanOssendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Thank you for your contribution.

However I think this is the wrong approach to solve this issue. The PrimitiveCriteria was meant to deal with the .net primitives (int, string, DateTime, ...) and not with custom serializers.

I think the correct way would be something like adding a way to ISerializationFormatter to ask if it can check a particular type.
If yes: Skip PrimitiveCriteria
If no: Use PrimitiveCriteria

But this is something more fundamental where I'd like to get @rockfordlhotka opinion this. Your way works, maybe as a temporary implementation, but it should be implemented in another way for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Serializer for Criteria-Objects

2 participants