Skip to content

Commit

Permalink
Serialize Type instances using RuntimeTypeNameFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenBond committed Apr 18, 2017
1 parent 45a0d83 commit c931e4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Orleans/Serialization/BuiltInTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Orleans.CodeGeneration;
using Orleans.Concurrency;
using Orleans.Runtime;
using Orleans.Utilities;

namespace Orleans.Serialization
{
Expand Down Expand Up @@ -1643,12 +1644,12 @@ internal static object CopyDateTimeOffset(object obj, ICopyContext context)

internal static void SerializeType(object obj, ISerializationContext context, Type expected)
{
context.StreamWriter.Write(((Type)obj).OrleansTypeKeyString());
context.StreamWriter.Write(RuntimeTypeNameFormatter.Format((Type)obj));
}

internal static object DeserializeType(Type expected, IDeserializationContext context)
{
return context.SerializationManager.ResolveTypeName(context.StreamReader.ReadString());
return Type.GetType(context.StreamReader.ReadString());
}

internal static object CopyType(object obj, ICopyContext context)
Expand Down

0 comments on commit c931e4a

Please sign in to comment.