Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 12ab8c6

Browse files
committed
fix tests
1 parent 0f77da2 commit 12ab8c6

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/ServiceStack.Text/JsConfig.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ public static class JsConfig
1616
{
1717
static JsConfig()
1818
{
19-
//In-built default serialization, to Deserialize Color struct do:
20-
//JsConfig<System.Drawing.Color>.SerializeFn = c => c.ToString().Replace("Color ", "").Replace("[", "").Replace("]", "");
21-
//JsConfig<System.Drawing.Color>.DeSerializeFn = System.Drawing.Color.FromName;
22-
JsConfig<Type>.SerializeFn = x => x.ToString();
23-
JsConfig<MethodInfo>.SerializeFn = x => x.ToString();
24-
JsConfig<PropertyInfo>.SerializeFn = x => x.ToString();
25-
JsConfig<FieldInfo>.SerializeFn = x => x.ToString();
26-
JsConfig<MemberInfo>.SerializeFn = x => x.ToString();
27-
JsConfig<ParameterInfo>.SerializeFn = x => x.ToString();
28-
2919
Reset();
3020
LicenseUtils.Init();
3121
}

src/ServiceStack.Text/JsConfigScope.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Threading;
33
using System.Collections.Generic;
4+
using System.Reflection;
45
using ServiceStack.Text.Json;
56
using ServiceStack.Text.Jsv;
67
using ServiceStack.Text.Common;

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,13 @@ internal static void Reset()
594594
"IgnoreDataMemberAttribute",
595595
"JsonIgnoreAttribute"
596596
};
597+
598+
JsConfig<Type>.SerializeFn = x => x?.ToString();
599+
JsConfig<MethodInfo>.SerializeFn = x => x?.ToString();
600+
JsConfig<PropertyInfo>.SerializeFn = x => x?.ToString();
601+
JsConfig<FieldInfo>.SerializeFn = x => x?.ToString();
602+
JsConfig<MemberInfo>.SerializeFn = x => x?.ToString();
603+
JsConfig<ParameterInfo>.SerializeFn = x => x?.ToString();
597604
}
598605

599606
public static PropertyInfo[] GetSerializableProperties(this Type type)

0 commit comments

Comments
 (0)