C#C
C#3y ago
Ninshu

❔ Field / Property Initialized By Method

Hello, I could have sworn I read somewhere in the .NET API's that there was an attribute you could use to tell the compiler that a property was initialized by a certain method.

If anyone knows the name of the attribute I would be eternally greatful. I am creating a blazor wasm application. It is annoying to have to keep setting my component properties to { get; set; } = null! when they are being set by
OnInitialized
or
OnInitializedAsync
.
Was this page helpful?