Skip to content

Commit 85dd232

Browse files
committed
Fix issues netstandard2 errors
1 parent 4ebe2c5 commit 85dd232

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/GuardClauses/GuardAgainstExpressionExtensions.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public static T Expression<T>(this IGuardClause guardClause,
2323
Func<T, bool> func,
2424
T input,
2525
string message,
26-
[CallerArgumentExpression("input")] string? parameterName = null) where T : struct
26+
#if NET7_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
27+
[CallerArgumentExpression("input")]
28+
#endif
29+
string? parameterName = null) where T : struct
2730
{
2831
if (func(input))
2932
{
@@ -50,7 +53,10 @@ public static async Task<T> ExpressionAsync<T>(this IGuardClause guardClause,
5053
Func<T, Task<bool>> func,
5154
T input,
5255
string message,
53-
[CallerArgumentExpression("input")] string? parameterName = null) where T : struct
56+
#if NET7_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
57+
[CallerArgumentExpression("input")]
58+
#endif
59+
string? parameterName = null) where T : struct
5460
{
5561
if (await func(input))
5662
{

src/GuardClauses/GuardAgainstOutOfRangeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static DateTime NullOrOutOfSQLDateRange(this IGuardClause guardClause,
131131
#else
132132
public static DateTime NullOrOutOfSQLDateRange(this IGuardClause guardClause,
133133
[NotNull][ValidatedNotNull] DateTime? input,
134-
[CallerArgumentExpression("input")] string parameterName = null,
134+
[CallerArgumentExpression("input")] string? parameterName = null,
135135
string? message = null)
136136
#endif
137137
{

0 commit comments

Comments
 (0)