Skip to content

Commit 7061e4c

Browse files
committed
Use 'is' operator
1 parent 2b4ef36 commit 7061e4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/CustomFunctions/TimeOffset/TimeOffsetExpression.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public TimeOffsetExpression(LiteralConstantExpression timeSpanConstant)
3636
{
3737
ArgumentGuard.NotNull(timeSpanConstant);
3838

39-
if (timeSpanConstant.TypedValue.GetType() != typeof(TimeSpan))
39+
if (timeSpanConstant.TypedValue is not TimeSpan timeSpan)
4040
{
4141
throw new ArgumentException($"Constant must contain a {nameof(TimeSpan)}.", nameof(timeSpanConstant));
4242
}
4343

4444
_timeSpanConstant = timeSpanConstant;
4545

46-
Value = (TimeSpan)timeSpanConstant.TypedValue;
46+
Value = timeSpan;
4747
}
4848

4949
public override TResult Accept<TArgument, TResult>(QueryExpressionVisitor<TArgument, TResult> visitor, TArgument argument)

0 commit comments

Comments
 (0)