diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-12 21:06:54 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-12 21:06:54 -0500 |
| commit | e1b2b2e77e03c2f858c06fdeabb2da16f719d921 (patch) | |
| tree | c4359f6985fde58df60091777018257fbfed87e8 /ServiceStack/StringMapTypeDeserializer.cs | |
| parent | 511a8702c29445288251fcf841c394e837db19cc (diff) | |
removed dead code
Diffstat (limited to 'ServiceStack/StringMapTypeDeserializer.cs')
| -rw-r--r-- | ServiceStack/StringMapTypeDeserializer.cs | 13 |
1 files changed, 9 insertions, 4 deletions
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<Type, object> _CreateInstanceFn; + private readonly Func<Type, Func<string, object>> _GetParseFn; + + public StringMapTypeDeserializer(Func<Type, object> createInstanceFn, Func<Type, Func<string, object>> 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))) { |
