Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ObjectSerializer to support serialization of known types without generics #7235

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

ReubenBond
Copy link
Member

@ReubenBond ReubenBond commented Aug 27, 2021

This adds ObjectSerializer, which has Serialize and Deserialize methods which accept a Type as a parameter. The Type parameter is the expected type of the value being serialized/deserialized.
In cases where the type exactly matches the type which was serialized, Orleans will not write full type information to the payload, and can instead set a flag in the payload indicating that the value is the expected type.
This means that the Serialize and Deserialize calls must have the same exact Type value or the deserialization may not know how to deserialize the value.

This complements the existing classes:

  • Serializer, which has generic Serialize<T> and Deserialize<T> methods, where T is the expected type.
  • Serializer<T>, which has Serialize and Deserialize methods which use the class' T as the expected type.

@ReubenBond ReubenBond added this to the 4.0.0 milestone Aug 27, 2021
@ReubenBond ReubenBond force-pushed the feature/serializer-type-as-param branch from 6265a3d to 716b59b Compare August 27, 2021 14:56
@ReubenBond ReubenBond merged commit 5ea4c18 into dotnet:main Aug 27, 2021
@ReubenBond ReubenBond deleted the feature/serializer-type-as-param branch August 27, 2021 17:20
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant