-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added AsReadOnly extension methods for IDictionary<T, U> and IList<T> #61172
Added AsReadOnly extension methods for IDictionary<T, U> and IList<T> #61172
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-collections Issue DetailsResolves #33033 I have made the code changes, but I have some problems:
Can someone please help me here?
|
src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
Outdated
Show resolved
Hide resolved
@Mrxx99 please go ahead and add triple-slash documentation directly on the implementation method. We will sync this up the |
@eiriktsarpalis I added the documentation comments. I looked at the documentation comments for the List.AsReadOnly() method and the type and constructor documentation for ReadOnlyCollection and ReadOnlyDictionary<TKey, TValue> and combined the information from them. I hope they are okay. List.AsReadOnly()
ReadOnlyCollection
ReadOnlyDictionary
|
src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs
Show resolved
Hide resolved
cedde23
to
d88abd7
Compare
Resolves #33033
I have made the code changes
, but I have some problems:- Using the ReadOnlyDictionary<T, U> in the CollectionExtensions class in System.Collections.csproj is not possible. It can't find the reference and I don't know what to do here. Adding the System.ObjectModel.csproj to the System.Collections.sln and adding a project reference from that project to System.Collections.csproj did not work.- Adding the ref project for System.ObjectModel to the ref project for System.Collections complains about a cycle because System.ObjectModel already references System.Collections. With that is it even possible to add the extension method for ReadOnlyDictionary to CollectionExtensions in System.Collections? (ReadOnlyCollection is no problem because it is inside the System.Runtime.dll)- Where should XML-Doc comments be added? The other methods in CollectionExtensions have none but they show up in intellisense.Can someone please help me here?