Skip to content
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

Remove ! from Microsoft.Extensions.Caching.Abstractions #64147

Closed
maxkoshevoi opened this issue Jan 22, 2022 · 4 comments · Fixed by #85918
Closed

Remove ! from Microsoft.Extensions.Caching.Abstractions #64147

maxkoshevoi opened this issue Jan 22, 2022 · 4 comments · Fixed by #85918

Comments

@maxkoshevoi
Copy link
Contributor

maxkoshevoi commented Jan 22, 2022

This is a blanket issue for all ! operations that were added in #64018
They should be removed or reviewed.

Left to be fixed/reviewed:

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jan 22, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Jan 22, 2022

Tagging subscribers to this area: @dotnet/area-extensions-caching
See info in area-owners.md if you want to be subscribed.

Issue Details

This is a blanket issue for all ! operations that were added in #64018
They should be removed or reviewed.

Left to be fixed/reviewed:

Author: maxkoshevoi
Assignees: -
Labels:

untriaged, area-Extensions-Caching

Milestone: -

@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label Jan 25, 2022
@maryamariyan maryamariyan added this to the 7.0.0 milestone Jan 25, 2022
@eerhardt eerhardt modified the milestones: 7.0.0, Future Jul 20, 2022
@hrrrrustic
Copy link
Contributor

hrrrrustic commented May 8, 2023

@eerhardt There is only one ! left that was discussed in initial PR #64018 (comment)

foreach (PostEvictionCallbackRegistration postEvictionCallback in options.PostEvictionCallbacks)
{
entry.RegisterPostEvictionCallback(postEvictionCallback.EvictionCallback!, postEvictionCallback.State);
}

I don't think it's a bug because it doesn't make any sense to register null callbacks. Is it fine to just add null-check (with throwing) before invocation and remove last !?

@eerhardt
Copy link
Member

eerhardt commented May 8, 2023

Yes, I think that is a fine solution here. Check if it EvictionCallback is null, and throw an exception here saying it can't be null.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 8, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants