(#42) Use NRT for AddNullIf__

This commit is contained in:
Oliver Booth 2021-07-19 11:38:24 +01:00
parent 14b43adf82
commit 92d60a6db8
No known key found for this signature in database
GPG Key ID: A4AC17007530E9B4
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -18,7 +18,7 @@ namespace X10D
/// <see langword="null" /> if <paramref name="value" /> is <see langword="null" /> or equal to
/// <see cref="string.Empty" />, or <paramref name="value" /> otherwise.
/// </returns>
public static string? AsNullIfEmpty(this string value)
public static string? AsNullIfEmpty(this string? value)
{
return string.IsNullOrEmpty(value) ? null : value;
}
@ -32,7 +32,7 @@ namespace X10D
/// <see langword="null" /> if <paramref name="value" /> is <see langword="null" /> or equal to
/// <see cref="string.Empty" /> or is composed of only whitespace characters, or <paramref name="value" /> otherwise.
/// </returns>
public static string? AsNullIfWhiteSpace(this string value)
public static string? AsNullIfWhiteSpace(this string? value)
{
return string.IsNullOrWhiteSpace(value) ? null : value;
}