You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
I'd like to suggest making the nullability of the generated properties optional. I think for most use-cases it can be safely assumed the resources will always return a value (falling back to the neutral language if the thread's current language is not available).
As it is currently, I'd need to litter my code with lot's of ! everywhere I access Resources (e.g. string.Format(Resources.MyResource!, someVar) instead of string.Format(Resources.MyResource, someVar).
The text was updated successfully, but these errors were encountered:
I also think for most use-cases it can be safely assumed the resources will always return a value, but what would be the best way? I came up with the following ideas.
Personally, I'd go with Option 1 because:
Option 2 hides a problem in the unlikely case there is one.
Option 3 adds a (tiny) extra overhead because each resource access performs an additional if-check.
I took option 1 and published v1.0.4. Now that I replaced SyntaxFactory with StringBuilder, it should be a little bit faster. Thanks for your feedback! :)
I'd like to suggest making the nullability of the generated properties optional. I think for most use-cases it can be safely assumed the resources will always return a value (falling back to the neutral language if the thread's current language is not available).
As it is currently, I'd need to litter my code with lot's of
!
everywhere I accessResources
(e.g.string.Format(Resources.MyResource!, someVar)
instead ofstring.Format(Resources.MyResource, someVar)
.The text was updated successfully, but these errors were encountered: