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

Commit aab6143

Browse files
committed
Make PCL compatible
1 parent 8b834ec commit aab6143

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ServiceStack.Text/Common/DeserializeCustomGenericType.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using ServiceStack.Text.Json;
34

45
namespace ServiceStack.Text.Common
@@ -40,7 +41,8 @@ public static object ParseTuple(Type tupleType, string value)
4041
Serializer.EatItemSeperatorOrMapEndChar(value, ref index);
4142
}
4243

43-
var ctor = tupleType.GetConstructor(genericArgs);
44+
var ctor = tupleType.DeclaredConstructors()
45+
.First(x => x.GetParameters().Length == genericArgs.Length);
4446
return ctor.Invoke(argValues);
4547
}
4648
}

0 commit comments

Comments
 (0)