Skip to content

Commit

Permalink
Avoid serializing generated/abstract/framework types
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenBond committed Dec 12, 2023
1 parent 30ee6cf commit 4d22b4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Orleans.Serialization.MessagePack/MessagePackCodec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ bool IGeneralizedCodec.IsSupportedType(Type type)
return true;
}

if (CommonCodecTypeFilter.IsAbstractOrFrameworkType(type))
{
return false;
}

foreach (var selector in _serializableTypeSelectors)
{
if (selector.IsSupportedType(type))
Expand Down Expand Up @@ -205,6 +210,11 @@ object IDeepCopier.DeepCopy(object input, CopyContext context)
/// <inheritdoc/>
bool IGeneralizedCopier.IsSupportedType(Type type)
{
if (CommonCodecTypeFilter.IsAbstractOrFrameworkType(type))
{
return false;
}

foreach (var selector in _copyableTypeSelectors)
{
if (selector.IsSupportedType(type))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<TargetFrameworks>$(DefaultTargetFrameworks);netstandard2.1</TargetFrameworks>
<PackageDescription>MessagePack integration for Orleans.Serialization</PackageDescription>
<OrleansBuildTimeCodeGen>true</OrleansBuildTimeCodeGen>
<IsOrleansFrameworkPart>false</IsOrleansFrameworkPart>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4d22b4f

Please sign in to comment.