Skip to content

Commit 7bafcea

Browse files
committed
Address feedback from review
1 parent 9896a25 commit 7bafcea

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Shared/TaskToApm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static TResult End<TResult>(IAsyncResult asyncResult)
5454
return task.GetAwaiter().GetResult();
5555
}
5656

57-
throw new ArgumentException($"{nameof(asyncResult)} must be a TaskAsyncResult wrapping a {typeof(TResult).Name}.", nameof(asyncResult));
57+
throw new ArgumentException($"{nameof(asyncResult)} must be a TaskAsyncResult wrapping a Task returning a {typeof(TResult).Name}.", nameof(asyncResult));
5858
}
5959

6060
/// <summary>Provides a simple IAsyncResult that wraps a Task.</summary>

src/Shared/ThrowHelpers/ArgumentThrowHelper.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ namespace Microsoft.AspNetCore.Shared;
1111

1212
internal static partial class ArgumentThrowHelper
1313
{
14-
#if !NET7_0_OR_GREATER || NETSTANDARD ||NETFRAMEWORK
15-
private const string EmptyString = "";
16-
#endif
17-
1814
/// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null or an <see cref="ArgumentException"/> if it is empty.</summary>
1915
/// <param name="argument">The reference type argument to validate as neither null nor empty.</param>
2016
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
2117
public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression("argument")] string? paramName = null)
2218
{
23-
#if !NET7_0_OR_GREATER || NETSTANDARD ||NETFRAMEWORK
24-
if (argument is null or EmptyString)
19+
#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
20+
if (argument is null or string.Empty)
2521
{
2622
ArgumentNullThrowHelper.ThrowIfNull(argument);
2723
Throw(paramName);
@@ -31,7 +27,7 @@ public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumen
3127
#endif
3228
}
3329

34-
#if !NET7_0_OR_GREATER || NETSTANDARD ||NETFRAMEWORK
30+
#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
3531
[DoesNotReturn]
3632
internal static void Throw(string? paramName) =>
3733
throw new ArgumentException("The value cannot be an empty string.", paramName);

0 commit comments

Comments
 (0)