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

Commit 69d2c56

Browse files
committed
don't by-pass string escaping for strings in Json ITypeSerializing<T>
1 parent f92fb84 commit 69d2c56

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/ServiceStack.Text/JsonSerializer.Generic.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public T DeserializeFromReader(TextReader reader)
4646
public string SerializeToString(T value)
4747
{
4848
if (value == null) return null;
49-
if (typeof(T) == typeof(string)) return value as string;
5049
if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface)
5150
{
5251
if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true;
@@ -63,11 +62,6 @@ public string SerializeToString(T value)
6362
public void SerializeToWriter(T value, TextWriter writer)
6463
{
6564
if (value == null) return;
66-
if (typeof(T) == typeof(string))
67-
{
68-
writer.Write(value);
69-
return;
70-
}
7165
if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface)
7266
{
7367
if (typeof(T).IsAbstract || typeof(T).IsInterface) JsState.IsWritingDynamic = true;

0 commit comments

Comments
 (0)