Skip to content

Commit

Permalink
Fix issues netstandard2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis committed Dec 23, 2023
1 parent 4ebe2c5 commit 85dd232
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/GuardClauses/GuardAgainstExpressionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public static T Expression<T>(this IGuardClause guardClause,
Func<T, bool> func,
T input,
string message,
[CallerArgumentExpression("input")] string? parameterName = null) where T : struct
#if NET7_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
[CallerArgumentExpression("input")]
#endif
string? parameterName = null) where T : struct
{
if (func(input))
{
Expand All @@ -50,7 +53,10 @@ public static async Task<T> ExpressionAsync<T>(this IGuardClause guardClause,
Func<T, Task<bool>> func,
T input,
string message,
[CallerArgumentExpression("input")] string? parameterName = null) where T : struct
#if NET7_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
[CallerArgumentExpression("input")]
#endif
string? parameterName = null) where T : struct
{
if (await func(input))
{
Expand Down
2 changes: 1 addition & 1 deletion src/GuardClauses/GuardAgainstOutOfRangeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static DateTime NullOrOutOfSQLDateRange(this IGuardClause guardClause,
#else
public static DateTime NullOrOutOfSQLDateRange(this IGuardClause guardClause,
[NotNull][ValidatedNotNull] DateTime? input,
[CallerArgumentExpression("input")] string parameterName = null,
[CallerArgumentExpression("input")] string? parameterName = null,
string? message = null)
#endif
{
Expand Down

0 comments on commit 85dd232

Please sign in to comment.