Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Added mono conditional for detecting Type when serializing json
Browse files Browse the repository at this point in the history
  • Loading branch information
grumpydev committed Feb 17, 2012
1 parent ccc2056 commit 29915c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Nancy/Json/JsonSerializer.cs
Expand Up @@ -105,11 +105,17 @@ void SerializeValueImpl (object obj, StringBuilder output)
return;
}

#if !__MonoCS__
if (obj.GetType().Name == "RuntimeType")
{
obj = obj.ToString();
}

#else
if (obj.GetType().Name == "MonoType")
{
obj = obj.ToString();
}
#endif
Type valueType = obj.GetType ();
JavaScriptConverter jsc = serializer.GetConverter (valueType);
if (jsc != null) {
Expand Down

0 comments on commit 29915c9

Please sign in to comment.