Skip to content

Commit

Permalink
Support IReadOnlyCollection binding for ListValueRetriever (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
BL323 authored Apr 15, 2022
1 parent 3eda3d9 commit 19dc7f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public override bool CanRetrieve(KeyValuePair<string, string> keyValuePair, Type
|| genericType == typeof(IEnumerable<>)
|| genericType == typeof(ICollection<>)
|| genericType == typeof(IList<>)
|| genericType == typeof(IReadOnlyList<>);
|| genericType == typeof(IReadOnlyList<>)
|| genericType == typeof(IReadOnlyCollection<>);
}

protected override Type GetActualValueType(Type propertyType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protected override IEnumerable<Type> BuildPropertyTypes(Type valueType)
typeof(IList<>),
typeof(List<>),
typeof(IReadOnlyList<>),
typeof(IReadOnlyCollection<>),
};

return propertyTypeDefinitions.Select(x => x.MakeGenericType(valueType));
Expand Down

0 comments on commit 19dc7f6

Please sign in to comment.