Anders Bjerner
08/08/2024, 1:49 PMcsharp
if (SomeMethod().HasValue(out string? result)) {
}
instead of:
csharp
string? result = SomeMethod();
if (result.HasValue()) {
}
Umbraco by the way also has IsNullOrWhiteSpace
and similar extension methods for string
- opposed to using the normal static methods on the string
class. IIRC it does exactly the same as Søren's and my HasValue
method.