Seperate changes from #1023

The unrelated changes from #1023 (and more)
This commit is contained in:
Bond-009
2019-03-25 21:27:03 +01:00
parent 5024c52c60
commit 6566c91360
9 changed files with 72 additions and 108 deletions

View File

@@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Services
foreach (var propertyInfo in RestPath.GetSerializableProperties(type))
{
var propertySetFn = TypeAccessor.GetSetPropertyMethod(type, propertyInfo);
var propertySetFn = TypeAccessor.GetSetPropertyMethod(propertyInfo);
var propertyType = propertyInfo.PropertyType;
var propertyParseStringFn = GetParseFn(propertyType);
var propertySerializer = new PropertySerializerEntry(propertySetFn, propertyParseStringFn, propertyType);
@@ -110,9 +110,9 @@ namespace Emby.Server.Implementations.Services
}
}
internal class TypeAccessor
internal static class TypeAccessor
{
public static Action<object, object> GetSetPropertyMethod(Type type, PropertyInfo propertyInfo)
public static Action<object, object> GetSetPropertyMethod(PropertyInfo propertyInfo)
{
if (!propertyInfo.CanWrite || propertyInfo.GetIndexParameters().Length > 0)
{