Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor best practice for Non-nullable warnings

$
0
0

With blazor I get Non-nullable warnings all around the code. Those warnings seems to be wrong, however solving them introduces a lot of code with the only purpose to hide the warning while the value will never be null.

What is the best practice to solve or hide those warnings?

Example:

[Inject] private IStringLocalizer<Element> L { get; set; }Element.razor.cs(5, 50): [CS8618] Non-nullable property 'L' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>