From e1b2b2e77e03c2f858c06fdeabb2da16f719d921 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 12 Feb 2017 21:06:54 -0500 Subject: removed dead code --- ServiceStack/StringMapTypeDeserializer.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ServiceStack/StringMapTypeDeserializer.cs') diff --git a/ServiceStack/StringMapTypeDeserializer.cs b/ServiceStack/StringMapTypeDeserializer.cs index 8b76c39d0..82724fc4a 100644 --- a/ServiceStack/StringMapTypeDeserializer.cs +++ b/ServiceStack/StringMapTypeDeserializer.cs @@ -34,14 +34,19 @@ namespace ServiceStack.Serialization if (propertyType == typeof(string)) return s => s; - return ServiceStackHost.Instance.GetParseFn(propertyType); + return _GetParseFn(propertyType); } - public StringMapTypeDeserializer(Type type) + private readonly Func _CreateInstanceFn; + private readonly Func> _GetParseFn; + + public StringMapTypeDeserializer(Func createInstanceFn, Func> getParseFn, Type type) { + _CreateInstanceFn = createInstanceFn; + _GetParseFn = getParseFn; this.type = type; - foreach (var propertyInfo in type.GetSerializableProperties()) + foreach (var propertyInfo in RestPath.GetSerializableProperties(type)) { var propertySetFn = TypeAccessor.GetSetPropertyMethod(type, propertyInfo); var propertyType = propertyInfo.PropertyType; @@ -59,7 +64,7 @@ namespace ServiceStack.Serialization PropertySerializerEntry propertySerializerEntry = null; if (instance == null) - instance = ServiceStackHost.Instance.CreateInstance(type); + instance = _CreateInstanceFn(type); foreach (var pair in keyValuePairs.Where(x => !string.IsNullOrEmpty(x.Value))) { -- cgit v1.2.3