Merge pull request #4393 from crobibero/model-binder-readonly-list

Support IReadOnlyList in CommaDelimitedArrayModelBinder
This commit is contained in:
Bond-009
2020-11-06 16:29:06 +01:00
committed by GitHub

View File

@@ -15,7 +15,7 @@ namespace Jellyfin.Api.ModelBinders
public Task BindModelAsync(ModelBindingContext bindingContext)
{
var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
var elementType = bindingContext.ModelType.GetElementType();
var elementType = bindingContext.ModelType.GetElementType() ?? bindingContext.ModelType.GenericTypeArguments[0];
var converter = TypeDescriptor.GetConverter(elementType);
if (valueProviderResult.Length > 1)