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

Set memory cache logger field as readonly #37289

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

lindexi
Copy link
Member

@lindexi lindexi commented Jun 2, 2020

No description provided.

@danmoseley
Copy link
Member

@stephentoub is there an analyzer that would spot this?

@stephentoub
Copy link
Member

is there an analyzer that would spot this?

Yes, built-in to VS:
image

@lindexi
Copy link
Member Author

lindexi commented Jun 3, 2020

I just want to transfer the Logger object to other properties, and I just saw that this field is not marked as read-only. I am worried that in other business codes will change the value of this field, if there are other business codes will change this field, then I can not pass this field to other objects

@stephentoub stephentoub merged commit 622b7d3 into dotnet:master Jul 9, 2020
@lindexi lindexi deleted the t/lindexi/memory-cache branch July 10, 2020 01:08
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants