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 was archived by the owner on May 26, 2025. It is now read-only.
.NET slowly transisions to code that uses nullable reference types. It would be great if Validot supports nullable reference types.
Problem:
publicrecordModel{publicstring?Language{get;init;}}publicsealedclassModelValidator:ISpecificationHolder<Model>{publicSpecification<Model>Specification{get;}publicModelValidator(){Specification= m =>m.Member(x =>x.Language!, language =>language// must use a null forgiving operator to use the IsLanguageCode extension .IsLanguageCode());}}publicstaticIRuleOut<string>IsLanguageCode(thisIRuleIn<string>@this)// string doesn't allow a null{// some code}
I can replace IRuleIn<string> with IRuleIn<string?> but "If the value entering the scope is null, scope commands are not executed." (DOCUMENTATION.md#null-policy) and using null forgiving operator is for me awful.
Nullable support in .NET Standard 2.0
Nullable package can be used to add nullable reference types to .NET Standard and/or a multi-target package can be created (I've never checked how e.g. .NET 6 handles nullable annotations from .NET Standard 2.0 package because I've always used multi-targeted packages so this need verification).
.NET slowly transisions to code that uses nullable reference types. It would be great if Validot supports nullable reference types.
Problem:
I can replace
IRuleIn<string>withIRuleIn<string?>but "If the value entering the scope is null, scope commands are not executed." (DOCUMENTATION.md#null-policy) and using null forgiving operator is for me awful.Nullable support in .NET Standard 2.0
Nullable package can be used to add nullable reference types to .NET Standard and/or a multi-target package can be created (I've never checked how e.g. .NET 6 handles nullable annotations from .NET Standard 2.0 package because I've always used multi-targeted packages so this need verification).