mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:25:41 +00:00
(#42) Use NRT for AddNullIf__
This commit is contained in:
parent
14b43adf82
commit
92d60a6db8
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -18,7 +18,7 @@ namespace X10D
|
|||||||
/// <see langword="null" /> if <paramref name="value" /> is <see langword="null" /> or equal to
|
/// <see langword="null" /> if <paramref name="value" /> is <see langword="null" /> or equal to
|
||||||
/// <see cref="string.Empty" />, or <paramref name="value" /> otherwise.
|
/// <see cref="string.Empty" />, or <paramref name="value" /> otherwise.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static string? AsNullIfEmpty(this string value)
|
public static string? AsNullIfEmpty(this string? value)
|
||||||
{
|
{
|
||||||
return string.IsNullOrEmpty(value) ? null : 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 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.
|
/// <see cref="string.Empty" /> or is composed of only whitespace characters, or <paramref name="value" /> otherwise.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static string? AsNullIfWhiteSpace(this string value)
|
public static string? AsNullIfWhiteSpace(this string? value)
|
||||||
{
|
{
|
||||||
return string.IsNullOrWhiteSpace(value) ? null : value;
|
return string.IsNullOrWhiteSpace(value) ? null : value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user